diff --git a/Makefile b/Makefile index 6505c33f..25ac2152 100644 --- a/Makefile +++ b/Makefile @@ -18,8 +18,15 @@ install: .PHONY: proto proto: - ignite generate proto-go - PATH="$$(go env GOPATH)/bin:$$PATH" buf generate proto --template proto/buf.gen.pulsar.yaml + ignite generate proto-go --yes + PATH="$$(go env GOPATH)/bin:$$PATH" buf generate proto --template proto/buf.gen.pulsar.yaml \ + --exclude-path proto/sourcehub/orbis/document.proto \ + --exclude-path proto/sourcehub/orbis/ring.proto \ + --exclude-path proto/sourcehub/orbis/tx.proto + PATH="$$(go env GOPATH)/bin:$$PATH" buf generate proto --template proto/buf.gen.orbis.optional.yaml \ + --path proto/sourcehub/orbis/document.proto \ + --path proto/sourcehub/orbis/ring.proto \ + --path proto/sourcehub/orbis/tx.proto .PHONY: test test: diff --git a/api/sourcehub/bulletin/tx.pulsar.go b/api/sourcehub/bulletin/tx.pulsar.go index a90f75f9..c4c14f3e 100644 --- a/api/sourcehub/bulletin/tx.pulsar.go +++ b/api/sourcehub/bulletin/tx.pulsar.go @@ -1841,3165 +1841,6 @@ func (x *fastReflection_MsgCreatePostResponse) ProtoMethods() *protoiface.Method } } -var _ protoreflect.List = (*_MsgUpdateRingPostByAcp_5_list)(nil) - -type _MsgUpdateRingPostByAcp_5_list struct { - list *[]string -} - -func (x *_MsgUpdateRingPostByAcp_5_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_MsgUpdateRingPostByAcp_5_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_MsgUpdateRingPostByAcp_5_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_MsgUpdateRingPostByAcp_5_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_MsgUpdateRingPostByAcp_5_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message MsgUpdateRingPostByAcp at list field NewPeerIds as it is not of Message kind")) -} - -func (x *_MsgUpdateRingPostByAcp_5_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_MsgUpdateRingPostByAcp_5_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_MsgUpdateRingPostByAcp_5_list) IsValid() bool { - return x.list != nil -} - -var ( - md_MsgUpdateRingPostByAcp protoreflect.MessageDescriptor - fd_MsgUpdateRingPostByAcp_creator protoreflect.FieldDescriptor - fd_MsgUpdateRingPostByAcp_namespace protoreflect.FieldDescriptor - fd_MsgUpdateRingPostByAcp_post_id protoreflect.FieldDescriptor - fd_MsgUpdateRingPostByAcp_artifact protoreflect.FieldDescriptor - fd_MsgUpdateRingPostByAcp_new_peer_ids protoreflect.FieldDescriptor - fd_MsgUpdateRingPostByAcp_new_threshold protoreflect.FieldDescriptor - fd_MsgUpdateRingPostByAcp_pss_interval protoreflect.FieldDescriptor -) - -func init() { - file_sourcehub_bulletin_tx_proto_init() - md_MsgUpdateRingPostByAcp = File_sourcehub_bulletin_tx_proto.Messages().ByName("MsgUpdateRingPostByAcp") - fd_MsgUpdateRingPostByAcp_creator = md_MsgUpdateRingPostByAcp.Fields().ByName("creator") - fd_MsgUpdateRingPostByAcp_namespace = md_MsgUpdateRingPostByAcp.Fields().ByName("namespace") - fd_MsgUpdateRingPostByAcp_post_id = md_MsgUpdateRingPostByAcp.Fields().ByName("post_id") - fd_MsgUpdateRingPostByAcp_artifact = md_MsgUpdateRingPostByAcp.Fields().ByName("artifact") - fd_MsgUpdateRingPostByAcp_new_peer_ids = md_MsgUpdateRingPostByAcp.Fields().ByName("new_peer_ids") - fd_MsgUpdateRingPostByAcp_new_threshold = md_MsgUpdateRingPostByAcp.Fields().ByName("new_threshold") - fd_MsgUpdateRingPostByAcp_pss_interval = md_MsgUpdateRingPostByAcp.Fields().ByName("pss_interval") -} - -var _ protoreflect.Message = (*fastReflection_MsgUpdateRingPostByAcp)(nil) - -type fastReflection_MsgUpdateRingPostByAcp MsgUpdateRingPostByAcp - -func (x *MsgUpdateRingPostByAcp) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgUpdateRingPostByAcp)(x) -} - -func (x *MsgUpdateRingPostByAcp) slowProtoReflect() protoreflect.Message { - mi := &file_sourcehub_bulletin_tx_proto_msgTypes[4] - 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_MsgUpdateRingPostByAcp_messageType fastReflection_MsgUpdateRingPostByAcp_messageType -var _ protoreflect.MessageType = fastReflection_MsgUpdateRingPostByAcp_messageType{} - -type fastReflection_MsgUpdateRingPostByAcp_messageType struct{} - -func (x fastReflection_MsgUpdateRingPostByAcp_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgUpdateRingPostByAcp)(nil) -} -func (x fastReflection_MsgUpdateRingPostByAcp_messageType) New() protoreflect.Message { - return new(fastReflection_MsgUpdateRingPostByAcp) -} -func (x fastReflection_MsgUpdateRingPostByAcp_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateRingPostByAcp -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgUpdateRingPostByAcp) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateRingPostByAcp -} - -// 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_MsgUpdateRingPostByAcp) Type() protoreflect.MessageType { - return _fastReflection_MsgUpdateRingPostByAcp_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgUpdateRingPostByAcp) New() protoreflect.Message { - return new(fastReflection_MsgUpdateRingPostByAcp) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgUpdateRingPostByAcp) Interface() protoreflect.ProtoMessage { - return (*MsgUpdateRingPostByAcp)(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_MsgUpdateRingPostByAcp) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Creator != "" { - value := protoreflect.ValueOfString(x.Creator) - if !f(fd_MsgUpdateRingPostByAcp_creator, value) { - return - } - } - if x.Namespace != "" { - value := protoreflect.ValueOfString(x.Namespace) - if !f(fd_MsgUpdateRingPostByAcp_namespace, value) { - return - } - } - if x.PostId != "" { - value := protoreflect.ValueOfString(x.PostId) - if !f(fd_MsgUpdateRingPostByAcp_post_id, value) { - return - } - } - if x.Artifact != "" { - value := protoreflect.ValueOfString(x.Artifact) - if !f(fd_MsgUpdateRingPostByAcp_artifact, value) { - return - } - } - if len(x.NewPeerIds) != 0 { - value := protoreflect.ValueOfList(&_MsgUpdateRingPostByAcp_5_list{list: &x.NewPeerIds}) - if !f(fd_MsgUpdateRingPostByAcp_new_peer_ids, value) { - return - } - } - if x.NewThreshold != nil { - value := protoreflect.ValueOfUint32(*x.NewThreshold) - if !f(fd_MsgUpdateRingPostByAcp_new_threshold, value) { - return - } - } - if x.PssInterval != nil { - value := protoreflect.ValueOfUint64(*x.PssInterval) - if !f(fd_MsgUpdateRingPostByAcp_pss_interval, 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_MsgUpdateRingPostByAcp) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.creator": - return x.Creator != "" - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.namespace": - return x.Namespace != "" - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.post_id": - return x.PostId != "" - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.artifact": - return x.Artifact != "" - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.new_peer_ids": - return len(x.NewPeerIds) != 0 - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.new_threshold": - return x.NewThreshold != nil - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.pss_interval": - return x.PssInterval != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.MsgUpdateRingPostByAcp")) - } - panic(fmt.Errorf("message sourcehub.bulletin.MsgUpdateRingPostByAcp 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_MsgUpdateRingPostByAcp) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.creator": - x.Creator = "" - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.namespace": - x.Namespace = "" - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.post_id": - x.PostId = "" - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.artifact": - x.Artifact = "" - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.new_peer_ids": - x.NewPeerIds = nil - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.new_threshold": - x.NewThreshold = nil - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.pss_interval": - x.PssInterval = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.MsgUpdateRingPostByAcp")) - } - panic(fmt.Errorf("message sourcehub.bulletin.MsgUpdateRingPostByAcp 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_MsgUpdateRingPostByAcp) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.creator": - value := x.Creator - return protoreflect.ValueOfString(value) - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.namespace": - value := x.Namespace - return protoreflect.ValueOfString(value) - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.post_id": - value := x.PostId - return protoreflect.ValueOfString(value) - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.artifact": - value := x.Artifact - return protoreflect.ValueOfString(value) - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.new_peer_ids": - if len(x.NewPeerIds) == 0 { - return protoreflect.ValueOfList(&_MsgUpdateRingPostByAcp_5_list{}) - } - listValue := &_MsgUpdateRingPostByAcp_5_list{list: &x.NewPeerIds} - return protoreflect.ValueOfList(listValue) - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.new_threshold": - if x.NewThreshold == nil { - return protoreflect.ValueOfUint32(uint32(0)) - } - return protoreflect.ValueOfUint32(*x.NewThreshold) - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.pss_interval": - if x.PssInterval == nil { - return protoreflect.ValueOfUint64(uint64(0)) - } - return protoreflect.ValueOfUint64(*x.PssInterval) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.MsgUpdateRingPostByAcp")) - } - panic(fmt.Errorf("message sourcehub.bulletin.MsgUpdateRingPostByAcp 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_MsgUpdateRingPostByAcp) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.creator": - x.Creator = value.Interface().(string) - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.namespace": - x.Namespace = value.Interface().(string) - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.post_id": - x.PostId = value.Interface().(string) - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.artifact": - x.Artifact = value.Interface().(string) - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.new_peer_ids": - lv := value.List() - clv := lv.(*_MsgUpdateRingPostByAcp_5_list) - x.NewPeerIds = *clv.list - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.new_threshold": - cv := uint32(value.Uint()) - x.NewThreshold = &cv - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.pss_interval": - cv := value.Uint() - x.PssInterval = &cv - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.MsgUpdateRingPostByAcp")) - } - panic(fmt.Errorf("message sourcehub.bulletin.MsgUpdateRingPostByAcp 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_MsgUpdateRingPostByAcp) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.new_peer_ids": - if x.NewPeerIds == nil { - x.NewPeerIds = []string{} - } - value := &_MsgUpdateRingPostByAcp_5_list{list: &x.NewPeerIds} - return protoreflect.ValueOfList(value) - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.creator": - panic(fmt.Errorf("field creator of message sourcehub.bulletin.MsgUpdateRingPostByAcp is not mutable")) - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.namespace": - panic(fmt.Errorf("field namespace of message sourcehub.bulletin.MsgUpdateRingPostByAcp is not mutable")) - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.post_id": - panic(fmt.Errorf("field post_id of message sourcehub.bulletin.MsgUpdateRingPostByAcp is not mutable")) - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.artifact": - panic(fmt.Errorf("field artifact of message sourcehub.bulletin.MsgUpdateRingPostByAcp is not mutable")) - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.new_threshold": - panic(fmt.Errorf("field new_threshold of message sourcehub.bulletin.MsgUpdateRingPostByAcp is not mutable")) - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.pss_interval": - panic(fmt.Errorf("field pss_interval of message sourcehub.bulletin.MsgUpdateRingPostByAcp is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.MsgUpdateRingPostByAcp")) - } - panic(fmt.Errorf("message sourcehub.bulletin.MsgUpdateRingPostByAcp 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_MsgUpdateRingPostByAcp) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.creator": - return protoreflect.ValueOfString("") - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.namespace": - return protoreflect.ValueOfString("") - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.post_id": - return protoreflect.ValueOfString("") - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.artifact": - return protoreflect.ValueOfString("") - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.new_peer_ids": - list := []string{} - return protoreflect.ValueOfList(&_MsgUpdateRingPostByAcp_5_list{list: &list}) - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.new_threshold": - return protoreflect.ValueOfUint32(uint32(0)) - case "sourcehub.bulletin.MsgUpdateRingPostByAcp.pss_interval": - return protoreflect.ValueOfUint64(uint64(0)) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.MsgUpdateRingPostByAcp")) - } - panic(fmt.Errorf("message sourcehub.bulletin.MsgUpdateRingPostByAcp 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_MsgUpdateRingPostByAcp) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - case "sourcehub.bulletin.MsgUpdateRingPostByAcp._new_threshold": - if x.NewThreshold != nil { - return x.Descriptor().Fields().ByName("new_threshold") - } - return nil - case "sourcehub.bulletin.MsgUpdateRingPostByAcp._pss_interval": - if x.PssInterval != nil { - return x.Descriptor().Fields().ByName("pss_interval") - } - return nil - default: - panic(fmt.Errorf("%s is not a oneof field in sourcehub.bulletin.MsgUpdateRingPostByAcp", d.FullName())) - } -} - -// 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_MsgUpdateRingPostByAcp) 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_MsgUpdateRingPostByAcp) 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_MsgUpdateRingPostByAcp) 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_MsgUpdateRingPostByAcp) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgUpdateRingPostByAcp) - 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.Creator) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Namespace) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.PostId) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Artifact) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.NewPeerIds) > 0 { - for _, s := range x.NewPeerIds { - l = len(s) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if x.NewThreshold != nil { - n += 1 + runtime.Sov(uint64(*x.NewThreshold)) - } - if x.PssInterval != nil { - n += 1 + runtime.Sov(uint64(*x.PssInterval)) - } - 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().(*MsgUpdateRingPostByAcp) - 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.PssInterval != nil { - i = runtime.EncodeVarint(dAtA, i, uint64(*x.PssInterval)) - i-- - dAtA[i] = 0x38 - } - if x.NewThreshold != nil { - i = runtime.EncodeVarint(dAtA, i, uint64(*x.NewThreshold)) - i-- - dAtA[i] = 0x30 - } - if len(x.NewPeerIds) > 0 { - for iNdEx := len(x.NewPeerIds) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.NewPeerIds[iNdEx]) - copy(dAtA[i:], x.NewPeerIds[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.NewPeerIds[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if len(x.Artifact) > 0 { - i -= len(x.Artifact) - copy(dAtA[i:], x.Artifact) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Artifact))) - i-- - dAtA[i] = 0x22 - } - if len(x.PostId) > 0 { - i -= len(x.PostId) - copy(dAtA[i:], x.PostId) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PostId))) - i-- - dAtA[i] = 0x1a - } - if len(x.Namespace) > 0 { - i -= len(x.Namespace) - copy(dAtA[i:], x.Namespace) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Namespace))) - i-- - dAtA[i] = 0x12 - } - if len(x.Creator) > 0 { - i -= len(x.Creator) - copy(dAtA[i:], x.Creator) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Creator))) - 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().(*MsgUpdateRingPostByAcp) - 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: MsgUpdateRingPostByAcp: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateRingPostByAcp: 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 Creator", 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.Creator = 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 Namespace", 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.Namespace = 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 PostId", 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.PostId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Artifact", 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.Artifact = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NewPeerIds", 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.NewPeerIds = append(x.NewPeerIds, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NewThreshold", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.NewThreshold = &v - case 7: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PssInterval", wireType) - } - var v 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++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - x.PssInterval = &v - 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_MsgUpdateRingPostByAcpResponse protoreflect.MessageDescriptor -) - -func init() { - file_sourcehub_bulletin_tx_proto_init() - md_MsgUpdateRingPostByAcpResponse = File_sourcehub_bulletin_tx_proto.Messages().ByName("MsgUpdateRingPostByAcpResponse") -} - -var _ protoreflect.Message = (*fastReflection_MsgUpdateRingPostByAcpResponse)(nil) - -type fastReflection_MsgUpdateRingPostByAcpResponse MsgUpdateRingPostByAcpResponse - -func (x *MsgUpdateRingPostByAcpResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgUpdateRingPostByAcpResponse)(x) -} - -func (x *MsgUpdateRingPostByAcpResponse) slowProtoReflect() protoreflect.Message { - mi := &file_sourcehub_bulletin_tx_proto_msgTypes[5] - 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_MsgUpdateRingPostByAcpResponse_messageType fastReflection_MsgUpdateRingPostByAcpResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgUpdateRingPostByAcpResponse_messageType{} - -type fastReflection_MsgUpdateRingPostByAcpResponse_messageType struct{} - -func (x fastReflection_MsgUpdateRingPostByAcpResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgUpdateRingPostByAcpResponse)(nil) -} -func (x fastReflection_MsgUpdateRingPostByAcpResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgUpdateRingPostByAcpResponse) -} -func (x fastReflection_MsgUpdateRingPostByAcpResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateRingPostByAcpResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgUpdateRingPostByAcpResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateRingPostByAcpResponse -} - -// 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_MsgUpdateRingPostByAcpResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgUpdateRingPostByAcpResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgUpdateRingPostByAcpResponse) New() protoreflect.Message { - return new(fastReflection_MsgUpdateRingPostByAcpResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgUpdateRingPostByAcpResponse) Interface() protoreflect.ProtoMessage { - return (*MsgUpdateRingPostByAcpResponse)(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_MsgUpdateRingPostByAcpResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgUpdateRingPostByAcpResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.MsgUpdateRingPostByAcpResponse")) - } - panic(fmt.Errorf("message sourcehub.bulletin.MsgUpdateRingPostByAcpResponse 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_MsgUpdateRingPostByAcpResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.MsgUpdateRingPostByAcpResponse")) - } - panic(fmt.Errorf("message sourcehub.bulletin.MsgUpdateRingPostByAcpResponse 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_MsgUpdateRingPostByAcpResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.MsgUpdateRingPostByAcpResponse")) - } - panic(fmt.Errorf("message sourcehub.bulletin.MsgUpdateRingPostByAcpResponse 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_MsgUpdateRingPostByAcpResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.MsgUpdateRingPostByAcpResponse")) - } - panic(fmt.Errorf("message sourcehub.bulletin.MsgUpdateRingPostByAcpResponse 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_MsgUpdateRingPostByAcpResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.MsgUpdateRingPostByAcpResponse")) - } - panic(fmt.Errorf("message sourcehub.bulletin.MsgUpdateRingPostByAcpResponse 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_MsgUpdateRingPostByAcpResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.MsgUpdateRingPostByAcpResponse")) - } - panic(fmt.Errorf("message sourcehub.bulletin.MsgUpdateRingPostByAcpResponse 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_MsgUpdateRingPostByAcpResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in sourcehub.bulletin.MsgUpdateRingPostByAcpResponse", 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_MsgUpdateRingPostByAcpResponse) 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_MsgUpdateRingPostByAcpResponse) 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_MsgUpdateRingPostByAcpResponse) 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_MsgUpdateRingPostByAcpResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgUpdateRingPostByAcpResponse) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateRingPostByAcpResponse) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateRingPostByAcpResponse) - 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: MsgUpdateRingPostByAcpResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateRingPostByAcpResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_MsgUpdateRingPostByThresholdSignature protoreflect.MessageDescriptor - fd_MsgUpdateRingPostByThresholdSignature_creator protoreflect.FieldDescriptor - fd_MsgUpdateRingPostByThresholdSignature_namespace protoreflect.FieldDescriptor - fd_MsgUpdateRingPostByThresholdSignature_post_id protoreflect.FieldDescriptor - fd_MsgUpdateRingPostByThresholdSignature_artifact protoreflect.FieldDescriptor - fd_MsgUpdateRingPostByThresholdSignature_signature_scheme protoreflect.FieldDescriptor - fd_MsgUpdateRingPostByThresholdSignature_signature protoreflect.FieldDescriptor -) - -func init() { - file_sourcehub_bulletin_tx_proto_init() - md_MsgUpdateRingPostByThresholdSignature = File_sourcehub_bulletin_tx_proto.Messages().ByName("MsgUpdateRingPostByThresholdSignature") - fd_MsgUpdateRingPostByThresholdSignature_creator = md_MsgUpdateRingPostByThresholdSignature.Fields().ByName("creator") - fd_MsgUpdateRingPostByThresholdSignature_namespace = md_MsgUpdateRingPostByThresholdSignature.Fields().ByName("namespace") - fd_MsgUpdateRingPostByThresholdSignature_post_id = md_MsgUpdateRingPostByThresholdSignature.Fields().ByName("post_id") - fd_MsgUpdateRingPostByThresholdSignature_artifact = md_MsgUpdateRingPostByThresholdSignature.Fields().ByName("artifact") - fd_MsgUpdateRingPostByThresholdSignature_signature_scheme = md_MsgUpdateRingPostByThresholdSignature.Fields().ByName("signature_scheme") - fd_MsgUpdateRingPostByThresholdSignature_signature = md_MsgUpdateRingPostByThresholdSignature.Fields().ByName("signature") -} - -var _ protoreflect.Message = (*fastReflection_MsgUpdateRingPostByThresholdSignature)(nil) - -type fastReflection_MsgUpdateRingPostByThresholdSignature MsgUpdateRingPostByThresholdSignature - -func (x *MsgUpdateRingPostByThresholdSignature) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgUpdateRingPostByThresholdSignature)(x) -} - -func (x *MsgUpdateRingPostByThresholdSignature) slowProtoReflect() protoreflect.Message { - mi := &file_sourcehub_bulletin_tx_proto_msgTypes[6] - 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_MsgUpdateRingPostByThresholdSignature_messageType fastReflection_MsgUpdateRingPostByThresholdSignature_messageType -var _ protoreflect.MessageType = fastReflection_MsgUpdateRingPostByThresholdSignature_messageType{} - -type fastReflection_MsgUpdateRingPostByThresholdSignature_messageType struct{} - -func (x fastReflection_MsgUpdateRingPostByThresholdSignature_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgUpdateRingPostByThresholdSignature)(nil) -} -func (x fastReflection_MsgUpdateRingPostByThresholdSignature_messageType) New() protoreflect.Message { - return new(fastReflection_MsgUpdateRingPostByThresholdSignature) -} -func (x fastReflection_MsgUpdateRingPostByThresholdSignature_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateRingPostByThresholdSignature -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgUpdateRingPostByThresholdSignature) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateRingPostByThresholdSignature -} - -// 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_MsgUpdateRingPostByThresholdSignature) Type() protoreflect.MessageType { - return _fastReflection_MsgUpdateRingPostByThresholdSignature_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgUpdateRingPostByThresholdSignature) New() protoreflect.Message { - return new(fastReflection_MsgUpdateRingPostByThresholdSignature) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgUpdateRingPostByThresholdSignature) Interface() protoreflect.ProtoMessage { - return (*MsgUpdateRingPostByThresholdSignature)(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_MsgUpdateRingPostByThresholdSignature) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Creator != "" { - value := protoreflect.ValueOfString(x.Creator) - if !f(fd_MsgUpdateRingPostByThresholdSignature_creator, value) { - return - } - } - if x.Namespace != "" { - value := protoreflect.ValueOfString(x.Namespace) - if !f(fd_MsgUpdateRingPostByThresholdSignature_namespace, value) { - return - } - } - if x.PostId != "" { - value := protoreflect.ValueOfString(x.PostId) - if !f(fd_MsgUpdateRingPostByThresholdSignature_post_id, value) { - return - } - } - if x.Artifact != "" { - value := protoreflect.ValueOfString(x.Artifact) - if !f(fd_MsgUpdateRingPostByThresholdSignature_artifact, value) { - return - } - } - if x.SignatureScheme != "" { - value := protoreflect.ValueOfString(x.SignatureScheme) - if !f(fd_MsgUpdateRingPostByThresholdSignature_signature_scheme, value) { - return - } - } - if len(x.Signature) != 0 { - value := protoreflect.ValueOfBytes(x.Signature) - if !f(fd_MsgUpdateRingPostByThresholdSignature_signature, 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_MsgUpdateRingPostByThresholdSignature) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.creator": - return x.Creator != "" - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.namespace": - return x.Namespace != "" - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.post_id": - return x.PostId != "" - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.artifact": - return x.Artifact != "" - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.signature_scheme": - return x.SignatureScheme != "" - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.signature": - return len(x.Signature) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature")) - } - panic(fmt.Errorf("message sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature 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_MsgUpdateRingPostByThresholdSignature) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.creator": - x.Creator = "" - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.namespace": - x.Namespace = "" - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.post_id": - x.PostId = "" - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.artifact": - x.Artifact = "" - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.signature_scheme": - x.SignatureScheme = "" - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.signature": - x.Signature = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature")) - } - panic(fmt.Errorf("message sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature 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_MsgUpdateRingPostByThresholdSignature) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.creator": - value := x.Creator - return protoreflect.ValueOfString(value) - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.namespace": - value := x.Namespace - return protoreflect.ValueOfString(value) - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.post_id": - value := x.PostId - return protoreflect.ValueOfString(value) - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.artifact": - value := x.Artifact - return protoreflect.ValueOfString(value) - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.signature_scheme": - value := x.SignatureScheme - return protoreflect.ValueOfString(value) - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.signature": - value := x.Signature - return protoreflect.ValueOfBytes(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature")) - } - panic(fmt.Errorf("message sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature 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_MsgUpdateRingPostByThresholdSignature) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.creator": - x.Creator = value.Interface().(string) - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.namespace": - x.Namespace = value.Interface().(string) - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.post_id": - x.PostId = value.Interface().(string) - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.artifact": - x.Artifact = value.Interface().(string) - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.signature_scheme": - x.SignatureScheme = value.Interface().(string) - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.signature": - x.Signature = value.Bytes() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature")) - } - panic(fmt.Errorf("message sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature 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_MsgUpdateRingPostByThresholdSignature) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.creator": - panic(fmt.Errorf("field creator of message sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature is not mutable")) - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.namespace": - panic(fmt.Errorf("field namespace of message sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature is not mutable")) - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.post_id": - panic(fmt.Errorf("field post_id of message sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature is not mutable")) - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.artifact": - panic(fmt.Errorf("field artifact of message sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature is not mutable")) - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.signature_scheme": - panic(fmt.Errorf("field signature_scheme of message sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature is not mutable")) - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.signature": - panic(fmt.Errorf("field signature of message sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature")) - } - panic(fmt.Errorf("message sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature 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_MsgUpdateRingPostByThresholdSignature) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.creator": - return protoreflect.ValueOfString("") - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.namespace": - return protoreflect.ValueOfString("") - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.post_id": - return protoreflect.ValueOfString("") - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.artifact": - return protoreflect.ValueOfString("") - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.signature_scheme": - return protoreflect.ValueOfString("") - case "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature.signature": - return protoreflect.ValueOfBytes(nil) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature")) - } - panic(fmt.Errorf("message sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature 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_MsgUpdateRingPostByThresholdSignature) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature", 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_MsgUpdateRingPostByThresholdSignature) 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_MsgUpdateRingPostByThresholdSignature) 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_MsgUpdateRingPostByThresholdSignature) 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_MsgUpdateRingPostByThresholdSignature) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgUpdateRingPostByThresholdSignature) - 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.Creator) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Namespace) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.PostId) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Artifact) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.SignatureScheme) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Signature) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateRingPostByThresholdSignature) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if len(x.Signature) > 0 { - i -= len(x.Signature) - copy(dAtA[i:], x.Signature) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signature))) - i-- - dAtA[i] = 0x32 - } - if len(x.SignatureScheme) > 0 { - i -= len(x.SignatureScheme) - copy(dAtA[i:], x.SignatureScheme) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SignatureScheme))) - i-- - dAtA[i] = 0x2a - } - if len(x.Artifact) > 0 { - i -= len(x.Artifact) - copy(dAtA[i:], x.Artifact) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Artifact))) - i-- - dAtA[i] = 0x22 - } - if len(x.PostId) > 0 { - i -= len(x.PostId) - copy(dAtA[i:], x.PostId) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PostId))) - i-- - dAtA[i] = 0x1a - } - if len(x.Namespace) > 0 { - i -= len(x.Namespace) - copy(dAtA[i:], x.Namespace) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Namespace))) - i-- - dAtA[i] = 0x12 - } - if len(x.Creator) > 0 { - i -= len(x.Creator) - copy(dAtA[i:], x.Creator) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Creator))) - 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().(*MsgUpdateRingPostByThresholdSignature) - 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: MsgUpdateRingPostByThresholdSignature: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateRingPostByThresholdSignature: 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 Creator", 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.Creator = 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 Namespace", 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.Namespace = 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 PostId", 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.PostId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Artifact", 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.Artifact = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SignatureScheme", 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.SignatureScheme = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) - } - var byteLen 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++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - 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.Signature = append(x.Signature[:0], dAtA[iNdEx:postIndex]...) - if x.Signature == nil { - x.Signature = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_MsgUpdateRingPostByThresholdSignatureResponse protoreflect.MessageDescriptor -) - -func init() { - file_sourcehub_bulletin_tx_proto_init() - md_MsgUpdateRingPostByThresholdSignatureResponse = File_sourcehub_bulletin_tx_proto.Messages().ByName("MsgUpdateRingPostByThresholdSignatureResponse") -} - -var _ protoreflect.Message = (*fastReflection_MsgUpdateRingPostByThresholdSignatureResponse)(nil) - -type fastReflection_MsgUpdateRingPostByThresholdSignatureResponse MsgUpdateRingPostByThresholdSignatureResponse - -func (x *MsgUpdateRingPostByThresholdSignatureResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgUpdateRingPostByThresholdSignatureResponse)(x) -} - -func (x *MsgUpdateRingPostByThresholdSignatureResponse) slowProtoReflect() protoreflect.Message { - mi := &file_sourcehub_bulletin_tx_proto_msgTypes[7] - 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_MsgUpdateRingPostByThresholdSignatureResponse_messageType fastReflection_MsgUpdateRingPostByThresholdSignatureResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgUpdateRingPostByThresholdSignatureResponse_messageType{} - -type fastReflection_MsgUpdateRingPostByThresholdSignatureResponse_messageType struct{} - -func (x fastReflection_MsgUpdateRingPostByThresholdSignatureResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgUpdateRingPostByThresholdSignatureResponse)(nil) -} -func (x fastReflection_MsgUpdateRingPostByThresholdSignatureResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgUpdateRingPostByThresholdSignatureResponse) -} -func (x fastReflection_MsgUpdateRingPostByThresholdSignatureResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateRingPostByThresholdSignatureResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgUpdateRingPostByThresholdSignatureResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateRingPostByThresholdSignatureResponse -} - -// 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_MsgUpdateRingPostByThresholdSignatureResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgUpdateRingPostByThresholdSignatureResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgUpdateRingPostByThresholdSignatureResponse) New() protoreflect.Message { - return new(fastReflection_MsgUpdateRingPostByThresholdSignatureResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgUpdateRingPostByThresholdSignatureResponse) Interface() protoreflect.ProtoMessage { - return (*MsgUpdateRingPostByThresholdSignatureResponse)(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_MsgUpdateRingPostByThresholdSignatureResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgUpdateRingPostByThresholdSignatureResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.MsgUpdateRingPostByThresholdSignatureResponse")) - } - panic(fmt.Errorf("message sourcehub.bulletin.MsgUpdateRingPostByThresholdSignatureResponse 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_MsgUpdateRingPostByThresholdSignatureResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.MsgUpdateRingPostByThresholdSignatureResponse")) - } - panic(fmt.Errorf("message sourcehub.bulletin.MsgUpdateRingPostByThresholdSignatureResponse 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_MsgUpdateRingPostByThresholdSignatureResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.MsgUpdateRingPostByThresholdSignatureResponse")) - } - panic(fmt.Errorf("message sourcehub.bulletin.MsgUpdateRingPostByThresholdSignatureResponse 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_MsgUpdateRingPostByThresholdSignatureResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.MsgUpdateRingPostByThresholdSignatureResponse")) - } - panic(fmt.Errorf("message sourcehub.bulletin.MsgUpdateRingPostByThresholdSignatureResponse 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_MsgUpdateRingPostByThresholdSignatureResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.MsgUpdateRingPostByThresholdSignatureResponse")) - } - panic(fmt.Errorf("message sourcehub.bulletin.MsgUpdateRingPostByThresholdSignatureResponse 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_MsgUpdateRingPostByThresholdSignatureResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.MsgUpdateRingPostByThresholdSignatureResponse")) - } - panic(fmt.Errorf("message sourcehub.bulletin.MsgUpdateRingPostByThresholdSignatureResponse 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_MsgUpdateRingPostByThresholdSignatureResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in sourcehub.bulletin.MsgUpdateRingPostByThresholdSignatureResponse", 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_MsgUpdateRingPostByThresholdSignatureResponse) 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_MsgUpdateRingPostByThresholdSignatureResponse) 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_MsgUpdateRingPostByThresholdSignatureResponse) 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_MsgUpdateRingPostByThresholdSignatureResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgUpdateRingPostByThresholdSignatureResponse) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateRingPostByThresholdSignatureResponse) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateRingPostByThresholdSignatureResponse) - 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: MsgUpdateRingPostByThresholdSignatureResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateRingPostByThresholdSignatureResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_RingReshareFinalizeSignDoc protoreflect.MessageDescriptor - fd_RingReshareFinalizeSignDoc_domain protoreflect.FieldDescriptor - fd_RingReshareFinalizeSignDoc_chain_id protoreflect.FieldDescriptor - fd_RingReshareFinalizeSignDoc_namespace protoreflect.FieldDescriptor - fd_RingReshareFinalizeSignDoc_post_id protoreflect.FieldDescriptor - fd_RingReshareFinalizeSignDoc_ring_pk protoreflect.FieldDescriptor - fd_RingReshareFinalizeSignDoc_current_payload_sha256 protoreflect.FieldDescriptor - fd_RingReshareFinalizeSignDoc_finalized_payload_sha256 protoreflect.FieldDescriptor - fd_RingReshareFinalizeSignDoc_block_number_nonce protoreflect.FieldDescriptor -) - -func init() { - file_sourcehub_bulletin_tx_proto_init() - md_RingReshareFinalizeSignDoc = File_sourcehub_bulletin_tx_proto.Messages().ByName("RingReshareFinalizeSignDoc") - fd_RingReshareFinalizeSignDoc_domain = md_RingReshareFinalizeSignDoc.Fields().ByName("domain") - fd_RingReshareFinalizeSignDoc_chain_id = md_RingReshareFinalizeSignDoc.Fields().ByName("chain_id") - fd_RingReshareFinalizeSignDoc_namespace = md_RingReshareFinalizeSignDoc.Fields().ByName("namespace") - fd_RingReshareFinalizeSignDoc_post_id = md_RingReshareFinalizeSignDoc.Fields().ByName("post_id") - fd_RingReshareFinalizeSignDoc_ring_pk = md_RingReshareFinalizeSignDoc.Fields().ByName("ring_pk") - fd_RingReshareFinalizeSignDoc_current_payload_sha256 = md_RingReshareFinalizeSignDoc.Fields().ByName("current_payload_sha256") - fd_RingReshareFinalizeSignDoc_finalized_payload_sha256 = md_RingReshareFinalizeSignDoc.Fields().ByName("finalized_payload_sha256") - fd_RingReshareFinalizeSignDoc_block_number_nonce = md_RingReshareFinalizeSignDoc.Fields().ByName("block_number_nonce") -} - -var _ protoreflect.Message = (*fastReflection_RingReshareFinalizeSignDoc)(nil) - -type fastReflection_RingReshareFinalizeSignDoc RingReshareFinalizeSignDoc - -func (x *RingReshareFinalizeSignDoc) ProtoReflect() protoreflect.Message { - return (*fastReflection_RingReshareFinalizeSignDoc)(x) -} - -func (x *RingReshareFinalizeSignDoc) slowProtoReflect() protoreflect.Message { - mi := &file_sourcehub_bulletin_tx_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_RingReshareFinalizeSignDoc_messageType fastReflection_RingReshareFinalizeSignDoc_messageType -var _ protoreflect.MessageType = fastReflection_RingReshareFinalizeSignDoc_messageType{} - -type fastReflection_RingReshareFinalizeSignDoc_messageType struct{} - -func (x fastReflection_RingReshareFinalizeSignDoc_messageType) Zero() protoreflect.Message { - return (*fastReflection_RingReshareFinalizeSignDoc)(nil) -} -func (x fastReflection_RingReshareFinalizeSignDoc_messageType) New() protoreflect.Message { - return new(fastReflection_RingReshareFinalizeSignDoc) -} -func (x fastReflection_RingReshareFinalizeSignDoc_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_RingReshareFinalizeSignDoc -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_RingReshareFinalizeSignDoc) Descriptor() protoreflect.MessageDescriptor { - return md_RingReshareFinalizeSignDoc -} - -// 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_RingReshareFinalizeSignDoc) Type() protoreflect.MessageType { - return _fastReflection_RingReshareFinalizeSignDoc_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_RingReshareFinalizeSignDoc) New() protoreflect.Message { - return new(fastReflection_RingReshareFinalizeSignDoc) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_RingReshareFinalizeSignDoc) Interface() protoreflect.ProtoMessage { - return (*RingReshareFinalizeSignDoc)(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_RingReshareFinalizeSignDoc) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Domain != "" { - value := protoreflect.ValueOfString(x.Domain) - if !f(fd_RingReshareFinalizeSignDoc_domain, value) { - return - } - } - if x.ChainId != "" { - value := protoreflect.ValueOfString(x.ChainId) - if !f(fd_RingReshareFinalizeSignDoc_chain_id, value) { - return - } - } - if x.Namespace != "" { - value := protoreflect.ValueOfString(x.Namespace) - if !f(fd_RingReshareFinalizeSignDoc_namespace, value) { - return - } - } - if x.PostId != "" { - value := protoreflect.ValueOfString(x.PostId) - if !f(fd_RingReshareFinalizeSignDoc_post_id, value) { - return - } - } - if x.RingPk != "" { - value := protoreflect.ValueOfString(x.RingPk) - if !f(fd_RingReshareFinalizeSignDoc_ring_pk, value) { - return - } - } - if len(x.CurrentPayloadSha256) != 0 { - value := protoreflect.ValueOfBytes(x.CurrentPayloadSha256) - if !f(fd_RingReshareFinalizeSignDoc_current_payload_sha256, value) { - return - } - } - if len(x.FinalizedPayloadSha256) != 0 { - value := protoreflect.ValueOfBytes(x.FinalizedPayloadSha256) - if !f(fd_RingReshareFinalizeSignDoc_finalized_payload_sha256, value) { - return - } - } - if x.BlockNumberNonce != uint64(0) { - value := protoreflect.ValueOfUint64(x.BlockNumberNonce) - if !f(fd_RingReshareFinalizeSignDoc_block_number_nonce, 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_RingReshareFinalizeSignDoc) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.domain": - return x.Domain != "" - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.chain_id": - return x.ChainId != "" - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.namespace": - return x.Namespace != "" - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.post_id": - return x.PostId != "" - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.ring_pk": - return x.RingPk != "" - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.current_payload_sha256": - return len(x.CurrentPayloadSha256) != 0 - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.finalized_payload_sha256": - return len(x.FinalizedPayloadSha256) != 0 - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.block_number_nonce": - return x.BlockNumberNonce != uint64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.RingReshareFinalizeSignDoc")) - } - panic(fmt.Errorf("message sourcehub.bulletin.RingReshareFinalizeSignDoc 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_RingReshareFinalizeSignDoc) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.domain": - x.Domain = "" - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.chain_id": - x.ChainId = "" - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.namespace": - x.Namespace = "" - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.post_id": - x.PostId = "" - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.ring_pk": - x.RingPk = "" - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.current_payload_sha256": - x.CurrentPayloadSha256 = nil - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.finalized_payload_sha256": - x.FinalizedPayloadSha256 = nil - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.block_number_nonce": - x.BlockNumberNonce = uint64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.RingReshareFinalizeSignDoc")) - } - panic(fmt.Errorf("message sourcehub.bulletin.RingReshareFinalizeSignDoc 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_RingReshareFinalizeSignDoc) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.domain": - value := x.Domain - return protoreflect.ValueOfString(value) - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.chain_id": - value := x.ChainId - return protoreflect.ValueOfString(value) - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.namespace": - value := x.Namespace - return protoreflect.ValueOfString(value) - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.post_id": - value := x.PostId - return protoreflect.ValueOfString(value) - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.ring_pk": - value := x.RingPk - return protoreflect.ValueOfString(value) - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.current_payload_sha256": - value := x.CurrentPayloadSha256 - return protoreflect.ValueOfBytes(value) - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.finalized_payload_sha256": - value := x.FinalizedPayloadSha256 - return protoreflect.ValueOfBytes(value) - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.block_number_nonce": - value := x.BlockNumberNonce - return protoreflect.ValueOfUint64(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.RingReshareFinalizeSignDoc")) - } - panic(fmt.Errorf("message sourcehub.bulletin.RingReshareFinalizeSignDoc 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_RingReshareFinalizeSignDoc) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.domain": - x.Domain = value.Interface().(string) - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.chain_id": - x.ChainId = value.Interface().(string) - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.namespace": - x.Namespace = value.Interface().(string) - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.post_id": - x.PostId = value.Interface().(string) - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.ring_pk": - x.RingPk = value.Interface().(string) - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.current_payload_sha256": - x.CurrentPayloadSha256 = value.Bytes() - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.finalized_payload_sha256": - x.FinalizedPayloadSha256 = value.Bytes() - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.block_number_nonce": - x.BlockNumberNonce = value.Uint() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.RingReshareFinalizeSignDoc")) - } - panic(fmt.Errorf("message sourcehub.bulletin.RingReshareFinalizeSignDoc 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_RingReshareFinalizeSignDoc) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.domain": - panic(fmt.Errorf("field domain of message sourcehub.bulletin.RingReshareFinalizeSignDoc is not mutable")) - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.chain_id": - panic(fmt.Errorf("field chain_id of message sourcehub.bulletin.RingReshareFinalizeSignDoc is not mutable")) - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.namespace": - panic(fmt.Errorf("field namespace of message sourcehub.bulletin.RingReshareFinalizeSignDoc is not mutable")) - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.post_id": - panic(fmt.Errorf("field post_id of message sourcehub.bulletin.RingReshareFinalizeSignDoc is not mutable")) - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.ring_pk": - panic(fmt.Errorf("field ring_pk of message sourcehub.bulletin.RingReshareFinalizeSignDoc is not mutable")) - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.current_payload_sha256": - panic(fmt.Errorf("field current_payload_sha256 of message sourcehub.bulletin.RingReshareFinalizeSignDoc is not mutable")) - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.finalized_payload_sha256": - panic(fmt.Errorf("field finalized_payload_sha256 of message sourcehub.bulletin.RingReshareFinalizeSignDoc is not mutable")) - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.block_number_nonce": - panic(fmt.Errorf("field block_number_nonce of message sourcehub.bulletin.RingReshareFinalizeSignDoc is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.RingReshareFinalizeSignDoc")) - } - panic(fmt.Errorf("message sourcehub.bulletin.RingReshareFinalizeSignDoc 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_RingReshareFinalizeSignDoc) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.domain": - return protoreflect.ValueOfString("") - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.chain_id": - return protoreflect.ValueOfString("") - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.namespace": - return protoreflect.ValueOfString("") - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.post_id": - return protoreflect.ValueOfString("") - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.ring_pk": - return protoreflect.ValueOfString("") - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.current_payload_sha256": - return protoreflect.ValueOfBytes(nil) - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.finalized_payload_sha256": - return protoreflect.ValueOfBytes(nil) - case "sourcehub.bulletin.RingReshareFinalizeSignDoc.block_number_nonce": - return protoreflect.ValueOfUint64(uint64(0)) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.bulletin.RingReshareFinalizeSignDoc")) - } - panic(fmt.Errorf("message sourcehub.bulletin.RingReshareFinalizeSignDoc 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_RingReshareFinalizeSignDoc) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in sourcehub.bulletin.RingReshareFinalizeSignDoc", 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_RingReshareFinalizeSignDoc) 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_RingReshareFinalizeSignDoc) 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_RingReshareFinalizeSignDoc) 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_RingReshareFinalizeSignDoc) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*RingReshareFinalizeSignDoc) - 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.Domain) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.ChainId) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Namespace) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.PostId) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.RingPk) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.CurrentPayloadSha256) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.FinalizedPayloadSha256) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.BlockNumberNonce != 0 { - n += 1 + runtime.Sov(uint64(x.BlockNumberNonce)) - } - 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().(*RingReshareFinalizeSignDoc) - 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.BlockNumberNonce != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.BlockNumberNonce)) - i-- - dAtA[i] = 0x40 - } - if len(x.FinalizedPayloadSha256) > 0 { - i -= len(x.FinalizedPayloadSha256) - copy(dAtA[i:], x.FinalizedPayloadSha256) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.FinalizedPayloadSha256))) - i-- - dAtA[i] = 0x3a - } - if len(x.CurrentPayloadSha256) > 0 { - i -= len(x.CurrentPayloadSha256) - copy(dAtA[i:], x.CurrentPayloadSha256) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CurrentPayloadSha256))) - i-- - dAtA[i] = 0x32 - } - if len(x.RingPk) > 0 { - i -= len(x.RingPk) - copy(dAtA[i:], x.RingPk) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.RingPk))) - i-- - dAtA[i] = 0x2a - } - if len(x.PostId) > 0 { - i -= len(x.PostId) - copy(dAtA[i:], x.PostId) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PostId))) - i-- - dAtA[i] = 0x22 - } - if len(x.Namespace) > 0 { - i -= len(x.Namespace) - copy(dAtA[i:], x.Namespace) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Namespace))) - i-- - dAtA[i] = 0x1a - } - if len(x.ChainId) > 0 { - i -= len(x.ChainId) - copy(dAtA[i:], x.ChainId) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ChainId))) - i-- - dAtA[i] = 0x12 - } - if len(x.Domain) > 0 { - i -= len(x.Domain) - copy(dAtA[i:], x.Domain) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Domain))) - 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().(*RingReshareFinalizeSignDoc) - 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: RingReshareFinalizeSignDoc: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: RingReshareFinalizeSignDoc: 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 Domain", 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.Domain = 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 ChainId", 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.ChainId = 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 Namespace", 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.Namespace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PostId", 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.PostId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RingPk", 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.RingPk = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CurrentPayloadSha256", wireType) - } - var byteLen 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++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - 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.CurrentPayloadSha256 = append(x.CurrentPayloadSha256[:0], dAtA[iNdEx:postIndex]...) - if x.CurrentPayloadSha256 == nil { - x.CurrentPayloadSha256 = []byte{} - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field FinalizedPayloadSha256", wireType) - } - var byteLen 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++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - 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.FinalizedPayloadSha256 = append(x.FinalizedPayloadSha256[:0], dAtA[iNdEx:postIndex]...) - if x.FinalizedPayloadSha256 == nil { - x.FinalizedPayloadSha256 = []byte{} - } - iNdEx = postIndex - case 8: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BlockNumberNonce", wireType) - } - x.BlockNumberNonce = 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.BlockNumberNonce |= uint64(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_MsgRegisterNamespace protoreflect.MessageDescriptor fd_MsgRegisterNamespace_creator protoreflect.FieldDescriptor @@ -5022,7 +1863,7 @@ func (x *MsgRegisterNamespace) ProtoReflect() protoreflect.Message { } func (x *MsgRegisterNamespace) slowProtoReflect() protoreflect.Message { - mi := &file_sourcehub_bulletin_tx_proto_msgTypes[9] + mi := &file_sourcehub_bulletin_tx_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5504,7 +2345,7 @@ func (x *MsgRegisterNamespaceResponse) ProtoReflect() protoreflect.Message { } func (x *MsgRegisterNamespaceResponse) slowProtoReflect() protoreflect.Message { - mi := &file_sourcehub_bulletin_tx_proto_msgTypes[10] + mi := &file_sourcehub_bulletin_tx_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5943,7 +2784,7 @@ func (x *MsgAddCollaborator) ProtoReflect() protoreflect.Message { } func (x *MsgAddCollaborator) slowProtoReflect() protoreflect.Message { - mi := &file_sourcehub_bulletin_tx_proto_msgTypes[11] + mi := &file_sourcehub_bulletin_tx_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6487,7 +3328,7 @@ func (x *MsgAddCollaboratorResponse) ProtoReflect() protoreflect.Message { } func (x *MsgAddCollaboratorResponse) slowProtoReflect() protoreflect.Message { - mi := &file_sourcehub_bulletin_tx_proto_msgTypes[12] + mi := &file_sourcehub_bulletin_tx_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6911,7 +3752,7 @@ func (x *MsgRemoveCollaborator) ProtoReflect() protoreflect.Message { } func (x *MsgRemoveCollaborator) slowProtoReflect() protoreflect.Message { - mi := &file_sourcehub_bulletin_tx_proto_msgTypes[13] + mi := &file_sourcehub_bulletin_tx_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7455,7 +4296,7 @@ func (x *MsgRemoveCollaboratorResponse) ProtoReflect() protoreflect.Message { } func (x *MsgRemoveCollaboratorResponse) slowProtoReflect() protoreflect.Message { - mi := &file_sourcehub_bulletin_tx_proto_msgTypes[14] + mi := &file_sourcehub_bulletin_tx_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7855,477 +4696,176 @@ func (x *fastReflection_MsgRemoveCollaboratorResponse) ProtoMethods() *protoifac } } -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: sourcehub/bulletin/tx.proto - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// MsgUpdateParams is the Msg/UpdateParams request type. -type MsgUpdateParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // authority is the address that controls the module (defaults to x/gov unless overwritten). - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // NOTE: All parameters must be supplied. - Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` -} - -func (x *MsgUpdateParams) Reset() { - *x = MsgUpdateParams{} - if protoimpl.UnsafeEnabled { - mi := &file_sourcehub_bulletin_tx_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgUpdateParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgUpdateParams) ProtoMessage() {} - -// Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. -func (*MsgUpdateParams) Descriptor() ([]byte, []int) { - return file_sourcehub_bulletin_tx_proto_rawDescGZIP(), []int{0} -} - -func (x *MsgUpdateParams) GetAuthority() string { - if x != nil { - return x.Authority - } - return "" -} - -func (x *MsgUpdateParams) GetParams() *Params { - if x != nil { - return x.Params - } - return nil -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -type MsgUpdateParamsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MsgUpdateParamsResponse) Reset() { - *x = MsgUpdateParamsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_sourcehub_bulletin_tx_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgUpdateParamsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgUpdateParamsResponse) ProtoMessage() {} - -// Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. -func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return file_sourcehub_bulletin_tx_proto_rawDescGZIP(), []int{1} -} - -type MsgCreatePost struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` - Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` - Artifact string `protobuf:"bytes,5,opt,name=artifact,proto3" json:"artifact,omitempty"` -} - -func (x *MsgCreatePost) Reset() { - *x = MsgCreatePost{} - if protoimpl.UnsafeEnabled { - mi := &file_sourcehub_bulletin_tx_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgCreatePost) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgCreatePost) ProtoMessage() {} - -// Deprecated: Use MsgCreatePost.ProtoReflect.Descriptor instead. -func (*MsgCreatePost) Descriptor() ([]byte, []int) { - return file_sourcehub_bulletin_tx_proto_rawDescGZIP(), []int{2} -} - -func (x *MsgCreatePost) GetCreator() string { - if x != nil { - return x.Creator - } - return "" -} - -func (x *MsgCreatePost) GetNamespace() string { - if x != nil { - return x.Namespace - } - return "" -} - -func (x *MsgCreatePost) GetPayload() []byte { - if x != nil { - return x.Payload - } - return nil -} - -func (x *MsgCreatePost) GetArtifact() string { - if x != nil { - return x.Artifact - } - return "" -} - -type MsgCreatePostResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MsgCreatePostResponse) Reset() { - *x = MsgCreatePostResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_sourcehub_bulletin_tx_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgCreatePostResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgCreatePostResponse) ProtoMessage() {} - -// Deprecated: Use MsgCreatePostResponse.ProtoReflect.Descriptor instead. -func (*MsgCreatePostResponse) Descriptor() ([]byte, []int) { - return file_sourcehub_bulletin_tx_proto_rawDescGZIP(), []int{3} -} - -type MsgUpdateRingPostByAcp struct { +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: sourcehub/bulletin/tx.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` - PostId string `protobuf:"bytes,3,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"` - Artifact string `protobuf:"bytes,4,opt,name=artifact,proto3" json:"artifact,omitempty"` - NewPeerIds []string `protobuf:"bytes,5,rep,name=new_peer_ids,json=newPeerIds,proto3" json:"new_peer_ids,omitempty"` - NewThreshold *uint32 `protobuf:"varint,6,opt,name=new_threshold,json=newThreshold,proto3,oneof" json:"new_threshold,omitempty"` - PssInterval *uint64 `protobuf:"varint,7,opt,name=pss_interval,json=pssInterval,proto3,oneof" json:"pss_interval,omitempty"` + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // NOTE: All parameters must be supplied. + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` } -func (x *MsgUpdateRingPostByAcp) Reset() { - *x = MsgUpdateRingPostByAcp{} +func (x *MsgUpdateParams) Reset() { + *x = MsgUpdateParams{} if protoimpl.UnsafeEnabled { - mi := &file_sourcehub_bulletin_tx_proto_msgTypes[4] + mi := &file_sourcehub_bulletin_tx_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *MsgUpdateRingPostByAcp) String() string { +func (x *MsgUpdateParams) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgUpdateRingPostByAcp) ProtoMessage() {} - -// Deprecated: Use MsgUpdateRingPostByAcp.ProtoReflect.Descriptor instead. -func (*MsgUpdateRingPostByAcp) Descriptor() ([]byte, []int) { - return file_sourcehub_bulletin_tx_proto_rawDescGZIP(), []int{4} -} - -func (x *MsgUpdateRingPostByAcp) GetCreator() string { - if x != nil { - return x.Creator - } - return "" -} - -func (x *MsgUpdateRingPostByAcp) GetNamespace() string { - if x != nil { - return x.Namespace - } - return "" -} +func (*MsgUpdateParams) ProtoMessage() {} -func (x *MsgUpdateRingPostByAcp) GetPostId() string { - if x != nil { - return x.PostId - } - return "" +// Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return file_sourcehub_bulletin_tx_proto_rawDescGZIP(), []int{0} } -func (x *MsgUpdateRingPostByAcp) GetArtifact() string { +func (x *MsgUpdateParams) GetAuthority() string { if x != nil { - return x.Artifact + return x.Authority } return "" } -func (x *MsgUpdateRingPostByAcp) GetNewPeerIds() []string { +func (x *MsgUpdateParams) GetParams() *Params { if x != nil { - return x.NewPeerIds + return x.Params } return nil } -func (x *MsgUpdateRingPostByAcp) GetNewThreshold() uint32 { - if x != nil && x.NewThreshold != nil { - return *x.NewThreshold - } - return 0 -} - -func (x *MsgUpdateRingPostByAcp) GetPssInterval() uint64 { - if x != nil && x.PssInterval != nil { - return *x.PssInterval - } - return 0 -} - -type MsgUpdateRingPostByAcpResponse struct { +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *MsgUpdateRingPostByAcpResponse) Reset() { - *x = MsgUpdateRingPostByAcpResponse{} +func (x *MsgUpdateParamsResponse) Reset() { + *x = MsgUpdateParamsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_sourcehub_bulletin_tx_proto_msgTypes[5] + mi := &file_sourcehub_bulletin_tx_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *MsgUpdateRingPostByAcpResponse) String() string { +func (x *MsgUpdateParamsResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgUpdateRingPostByAcpResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) ProtoMessage() {} -// Deprecated: Use MsgUpdateRingPostByAcpResponse.ProtoReflect.Descriptor instead. -func (*MsgUpdateRingPostByAcpResponse) Descriptor() ([]byte, []int) { - return file_sourcehub_bulletin_tx_proto_rawDescGZIP(), []int{5} +// Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return file_sourcehub_bulletin_tx_proto_rawDescGZIP(), []int{1} } -type MsgUpdateRingPostByThresholdSignature struct { +type MsgCreatePost struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` - PostId string `protobuf:"bytes,3,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"` - Artifact string `protobuf:"bytes,4,opt,name=artifact,proto3" json:"artifact,omitempty"` - SignatureScheme string `protobuf:"bytes,5,opt,name=signature_scheme,json=signatureScheme,proto3" json:"signature_scheme,omitempty"` - Signature []byte `protobuf:"bytes,6,opt,name=signature,proto3" json:"signature,omitempty"` + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` + Artifact string `protobuf:"bytes,5,opt,name=artifact,proto3" json:"artifact,omitempty"` } -func (x *MsgUpdateRingPostByThresholdSignature) Reset() { - *x = MsgUpdateRingPostByThresholdSignature{} +func (x *MsgCreatePost) Reset() { + *x = MsgCreatePost{} if protoimpl.UnsafeEnabled { - mi := &file_sourcehub_bulletin_tx_proto_msgTypes[6] + mi := &file_sourcehub_bulletin_tx_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *MsgUpdateRingPostByThresholdSignature) String() string { +func (x *MsgCreatePost) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MsgUpdateRingPostByThresholdSignature) ProtoMessage() {} +func (*MsgCreatePost) ProtoMessage() {} -// Deprecated: Use MsgUpdateRingPostByThresholdSignature.ProtoReflect.Descriptor instead. -func (*MsgUpdateRingPostByThresholdSignature) Descriptor() ([]byte, []int) { - return file_sourcehub_bulletin_tx_proto_rawDescGZIP(), []int{6} +// Deprecated: Use MsgCreatePost.ProtoReflect.Descriptor instead. +func (*MsgCreatePost) Descriptor() ([]byte, []int) { + return file_sourcehub_bulletin_tx_proto_rawDescGZIP(), []int{2} } -func (x *MsgUpdateRingPostByThresholdSignature) GetCreator() string { +func (x *MsgCreatePost) GetCreator() string { if x != nil { return x.Creator } return "" } -func (x *MsgUpdateRingPostByThresholdSignature) GetNamespace() string { +func (x *MsgCreatePost) GetNamespace() string { if x != nil { return x.Namespace } return "" } -func (x *MsgUpdateRingPostByThresholdSignature) GetPostId() string { +func (x *MsgCreatePost) GetPayload() []byte { if x != nil { - return x.PostId + return x.Payload } - return "" + return nil } -func (x *MsgUpdateRingPostByThresholdSignature) GetArtifact() string { +func (x *MsgCreatePost) GetArtifact() string { if x != nil { return x.Artifact } return "" } -func (x *MsgUpdateRingPostByThresholdSignature) GetSignatureScheme() string { - if x != nil { - return x.SignatureScheme - } - return "" -} - -func (x *MsgUpdateRingPostByThresholdSignature) GetSignature() []byte { - if x != nil { - return x.Signature - } - return nil -} - -type MsgUpdateRingPostByThresholdSignatureResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MsgUpdateRingPostByThresholdSignatureResponse) Reset() { - *x = MsgUpdateRingPostByThresholdSignatureResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_sourcehub_bulletin_tx_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgUpdateRingPostByThresholdSignatureResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgUpdateRingPostByThresholdSignatureResponse) ProtoMessage() {} - -// Deprecated: Use MsgUpdateRingPostByThresholdSignatureResponse.ProtoReflect.Descriptor instead. -func (*MsgUpdateRingPostByThresholdSignatureResponse) Descriptor() ([]byte, []int) { - return file_sourcehub_bulletin_tx_proto_rawDescGZIP(), []int{7} -} - -type RingReshareFinalizeSignDoc struct { +type MsgCreatePostResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"` - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` - PostId string `protobuf:"bytes,4,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"` - RingPk string `protobuf:"bytes,5,opt,name=ring_pk,json=ringPk,proto3" json:"ring_pk,omitempty"` - CurrentPayloadSha256 []byte `protobuf:"bytes,6,opt,name=current_payload_sha256,json=currentPayloadSha256,proto3" json:"current_payload_sha256,omitempty"` - FinalizedPayloadSha256 []byte `protobuf:"bytes,7,opt,name=finalized_payload_sha256,json=finalizedPayloadSha256,proto3" json:"finalized_payload_sha256,omitempty"` - BlockNumberNonce uint64 `protobuf:"varint,8,opt,name=block_number_nonce,json=blockNumberNonce,proto3" json:"block_number_nonce,omitempty"` } -func (x *RingReshareFinalizeSignDoc) Reset() { - *x = RingReshareFinalizeSignDoc{} +func (x *MsgCreatePostResponse) Reset() { + *x = MsgCreatePostResponse{} if protoimpl.UnsafeEnabled { - mi := &file_sourcehub_bulletin_tx_proto_msgTypes[8] + mi := &file_sourcehub_bulletin_tx_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *RingReshareFinalizeSignDoc) String() string { +func (x *MsgCreatePostResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*RingReshareFinalizeSignDoc) ProtoMessage() {} - -// Deprecated: Use RingReshareFinalizeSignDoc.ProtoReflect.Descriptor instead. -func (*RingReshareFinalizeSignDoc) Descriptor() ([]byte, []int) { - return file_sourcehub_bulletin_tx_proto_rawDescGZIP(), []int{8} -} - -func (x *RingReshareFinalizeSignDoc) GetDomain() string { - if x != nil { - return x.Domain - } - return "" -} - -func (x *RingReshareFinalizeSignDoc) GetChainId() string { - if x != nil { - return x.ChainId - } - return "" -} - -func (x *RingReshareFinalizeSignDoc) GetNamespace() string { - if x != nil { - return x.Namespace - } - return "" -} - -func (x *RingReshareFinalizeSignDoc) GetPostId() string { - if x != nil { - return x.PostId - } - return "" -} - -func (x *RingReshareFinalizeSignDoc) GetRingPk() string { - if x != nil { - return x.RingPk - } - return "" -} - -func (x *RingReshareFinalizeSignDoc) GetCurrentPayloadSha256() []byte { - if x != nil { - return x.CurrentPayloadSha256 - } - return nil -} - -func (x *RingReshareFinalizeSignDoc) GetFinalizedPayloadSha256() []byte { - if x != nil { - return x.FinalizedPayloadSha256 - } - return nil -} +func (*MsgCreatePostResponse) ProtoMessage() {} -func (x *RingReshareFinalizeSignDoc) GetBlockNumberNonce() uint64 { - if x != nil { - return x.BlockNumberNonce - } - return 0 +// Deprecated: Use MsgCreatePostResponse.ProtoReflect.Descriptor instead. +func (*MsgCreatePostResponse) Descriptor() ([]byte, []int) { + return file_sourcehub_bulletin_tx_proto_rawDescGZIP(), []int{3} } type MsgRegisterNamespace struct { @@ -8340,7 +4880,7 @@ type MsgRegisterNamespace struct { func (x *MsgRegisterNamespace) Reset() { *x = MsgRegisterNamespace{} if protoimpl.UnsafeEnabled { - mi := &file_sourcehub_bulletin_tx_proto_msgTypes[9] + mi := &file_sourcehub_bulletin_tx_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8354,7 +4894,7 @@ func (*MsgRegisterNamespace) ProtoMessage() {} // Deprecated: Use MsgRegisterNamespace.ProtoReflect.Descriptor instead. func (*MsgRegisterNamespace) Descriptor() ([]byte, []int) { - return file_sourcehub_bulletin_tx_proto_rawDescGZIP(), []int{9} + return file_sourcehub_bulletin_tx_proto_rawDescGZIP(), []int{4} } func (x *MsgRegisterNamespace) GetCreator() string { @@ -8382,7 +4922,7 @@ type MsgRegisterNamespaceResponse struct { func (x *MsgRegisterNamespaceResponse) Reset() { *x = MsgRegisterNamespaceResponse{} if protoimpl.UnsafeEnabled { - mi := &file_sourcehub_bulletin_tx_proto_msgTypes[10] + mi := &file_sourcehub_bulletin_tx_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8396,7 +4936,7 @@ func (*MsgRegisterNamespaceResponse) ProtoMessage() {} // Deprecated: Use MsgRegisterNamespaceResponse.ProtoReflect.Descriptor instead. func (*MsgRegisterNamespaceResponse) Descriptor() ([]byte, []int) { - return file_sourcehub_bulletin_tx_proto_rawDescGZIP(), []int{10} + return file_sourcehub_bulletin_tx_proto_rawDescGZIP(), []int{5} } func (x *MsgRegisterNamespaceResponse) GetNamespace() *Namespace { @@ -8419,7 +4959,7 @@ type MsgAddCollaborator struct { func (x *MsgAddCollaborator) Reset() { *x = MsgAddCollaborator{} if protoimpl.UnsafeEnabled { - mi := &file_sourcehub_bulletin_tx_proto_msgTypes[11] + mi := &file_sourcehub_bulletin_tx_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8433,7 +4973,7 @@ func (*MsgAddCollaborator) ProtoMessage() {} // Deprecated: Use MsgAddCollaborator.ProtoReflect.Descriptor instead. func (*MsgAddCollaborator) Descriptor() ([]byte, []int) { - return file_sourcehub_bulletin_tx_proto_rawDescGZIP(), []int{11} + return file_sourcehub_bulletin_tx_proto_rawDescGZIP(), []int{6} } func (x *MsgAddCollaborator) GetCreator() string { @@ -8468,7 +5008,7 @@ type MsgAddCollaboratorResponse struct { func (x *MsgAddCollaboratorResponse) Reset() { *x = MsgAddCollaboratorResponse{} if protoimpl.UnsafeEnabled { - mi := &file_sourcehub_bulletin_tx_proto_msgTypes[12] + mi := &file_sourcehub_bulletin_tx_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8482,7 +5022,7 @@ func (*MsgAddCollaboratorResponse) ProtoMessage() {} // Deprecated: Use MsgAddCollaboratorResponse.ProtoReflect.Descriptor instead. func (*MsgAddCollaboratorResponse) Descriptor() ([]byte, []int) { - return file_sourcehub_bulletin_tx_proto_rawDescGZIP(), []int{12} + return file_sourcehub_bulletin_tx_proto_rawDescGZIP(), []int{7} } func (x *MsgAddCollaboratorResponse) GetCollaboratorDid() string { @@ -8505,7 +5045,7 @@ type MsgRemoveCollaborator struct { func (x *MsgRemoveCollaborator) Reset() { *x = MsgRemoveCollaborator{} if protoimpl.UnsafeEnabled { - mi := &file_sourcehub_bulletin_tx_proto_msgTypes[13] + mi := &file_sourcehub_bulletin_tx_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8519,7 +5059,7 @@ func (*MsgRemoveCollaborator) ProtoMessage() {} // Deprecated: Use MsgRemoveCollaborator.ProtoReflect.Descriptor instead. func (*MsgRemoveCollaborator) Descriptor() ([]byte, []int) { - return file_sourcehub_bulletin_tx_proto_rawDescGZIP(), []int{13} + return file_sourcehub_bulletin_tx_proto_rawDescGZIP(), []int{8} } func (x *MsgRemoveCollaborator) GetCreator() string { @@ -8554,7 +5094,7 @@ type MsgRemoveCollaboratorResponse struct { func (x *MsgRemoveCollaboratorResponse) Reset() { *x = MsgRemoveCollaboratorResponse{} if protoimpl.UnsafeEnabled { - mi := &file_sourcehub_bulletin_tx_proto_msgTypes[14] + mi := &file_sourcehub_bulletin_tx_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8568,7 +5108,7 @@ func (*MsgRemoveCollaboratorResponse) ProtoMessage() {} // Deprecated: Use MsgRemoveCollaboratorResponse.ProtoReflect.Descriptor instead. func (*MsgRemoveCollaboratorResponse) Descriptor() ([]byte, []int) { - return file_sourcehub_bulletin_tx_proto_rawDescGZIP(), []int{14} + return file_sourcehub_bulletin_tx_proto_rawDescGZIP(), []int{9} } func (x *MsgRemoveCollaboratorResponse) GetCollaboratorDid() string { @@ -8589,11 +5129,11 @@ var file_sourcehub_bulletin_tx_proto_rawDesc = []byte{ 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, + 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x62, 0x75, 0x6c, 0x6c, 0x65, 0x74, - 0x69, 0x6e, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x22, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x62, 0x75, 0x6c, 0x6c, 0x65, - 0x74, 0x69, 0x6e, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x70, 0x72, + 0x69, 0x6e, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x62, 0x75, + 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc1, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, @@ -8618,166 +5158,90 @@ var file_sourcehub_bulletin_tx_proto_rawDesc = []byte{ 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x17, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x73, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xaa, 0x02, 0x0a, 0x16, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x73, 0x74, 0x42, - 0x79, 0x41, 0x63, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1c, - 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x17, 0x0a, 0x07, - 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, - 0x6f, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, - 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, - 0x74, 0x12, 0x20, 0x0a, 0x0c, 0x6e, 0x65, 0x77, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, - 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x65, 0x77, 0x50, 0x65, 0x65, 0x72, - 0x49, 0x64, 0x73, 0x12, 0x28, 0x0a, 0x0d, 0x6e, 0x65, 0x77, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, - 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x0c, 0x6e, 0x65, - 0x77, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x88, 0x01, 0x01, 0x12, 0x26, 0x0a, - 0x0c, 0x70, 0x73, 0x73, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x04, 0x48, 0x01, 0x52, 0x0b, 0x70, 0x73, 0x73, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, - 0x61, 0x6c, 0x88, 0x01, 0x01, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x6f, 0x72, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x6e, 0x65, 0x77, 0x5f, 0x74, 0x68, 0x72, 0x65, - 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x70, 0x73, 0x73, 0x5f, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22, 0x20, 0x0a, 0x1e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x52, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x73, 0x74, 0x42, 0x79, 0x41, 0x63, 0x70, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xeb, 0x01, 0x0a, 0x25, 0x4d, 0x73, 0x67, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x73, 0x74, 0x42, 0x79, - 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1c, 0x0a, 0x09, - 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x6f, - 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6f, 0x73, - 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x12, - 0x29, 0x0a, 0x10, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x63, 0x68, - 0x65, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x2f, 0x0a, 0x2d, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x52, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x73, 0x74, 0x42, 0x79, 0x54, 0x68, 0x72, - 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xbd, 0x02, 0x0a, 0x1a, 0x52, 0x69, 0x6e, 0x67, - 0x52, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x53, - 0x69, 0x67, 0x6e, 0x44, 0x6f, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x19, - 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, - 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x6f, 0x73, 0x74, 0x5f, - 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6f, 0x73, 0x74, 0x49, 0x64, - 0x12, 0x17, 0x0a, 0x07, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x72, 0x69, 0x6e, 0x67, 0x50, 0x6b, 0x12, 0x34, 0x0a, 0x16, 0x63, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x73, 0x68, 0x61, - 0x32, 0x35, 0x36, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x14, 0x63, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x68, 0x61, 0x32, 0x35, 0x36, 0x12, - 0x38, 0x0a, 0x18, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x16, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x50, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x53, 0x68, 0x61, 0x32, 0x35, 0x36, 0x12, 0x2c, 0x0a, 0x12, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, - 0x65, 0x72, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x22, 0x5c, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x52, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, - 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, - 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x5b, 0x0a, 0x1c, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x68, 0x75, 0x62, 0x2e, 0x62, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x2e, 0x4e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x22, 0x7e, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6c, 0x6c, - 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x6f, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x12, 0x22, 0x0a, 0x0c, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, - 0x61, 0x74, 0x6f, 0x72, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x6f, 0x72, 0x22, 0x47, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6c, 0x6c, - 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, - 0x5f, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6c, 0x6c, - 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x69, 0x64, 0x22, 0x81, 0x01, 0x0a, 0x15, - 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, - 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, - 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x22, 0x0a, - 0x0c, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, - 0x72, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x22, - 0x4a, 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6c, 0x6c, - 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, - 0x5f, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6c, 0x6c, - 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x69, 0x64, 0x32, 0xb6, 0x06, 0x0a, 0x03, - 0x4d, 0x73, 0x67, 0x12, 0x60, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x12, 0x23, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, - 0x62, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2b, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5c, 0x0a, 0x14, 0x4d, 0x73, 0x67, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, 0x07, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x5b, 0x0a, 0x1c, 0x4d, 0x73, 0x67, 0x52, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x62, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x2e, + 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x22, 0x7e, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, 0x43, 0x6f, + 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, + 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x62, + 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x6f, 0x72, 0x22, 0x47, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, 0x43, 0x6f, + 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, + 0x6f, 0x72, 0x5f, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, + 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x69, 0x64, 0x22, 0x81, 0x01, + 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x61, + 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, + 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, + 0x22, 0x0a, 0x0c, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, + 0x74, 0x6f, 0x72, 0x3a, 0x0c, 0x82, 0xe7, 0xb0, 0x2a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, + 0x72, 0x22, 0x4a, 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6f, + 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, + 0x6f, 0x72, 0x5f, 0x64, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, + 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x69, 0x64, 0x32, 0x9a, 0x04, + 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x60, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x23, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, + 0x62, 0x2e, 0x62, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2b, 0x2e, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x62, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x2e, + 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x50, 0x6f, 0x73, 0x74, 0x12, 0x21, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, + 0x62, 0x2e, 0x62, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x62, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x2e, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, - 0x6f, 0x73, 0x74, 0x12, 0x21, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, - 0x62, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x50, 0x6f, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, - 0x75, 0x62, 0x2e, 0x62, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x75, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x69, 0x6e, 0x67, 0x50, - 0x6f, 0x73, 0x74, 0x42, 0x79, 0x41, 0x63, 0x70, 0x12, 0x2a, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x6f, 0x0a, 0x11, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x28, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x62, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x2e, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x73, 0x74, 0x42, - 0x79, 0x41, 0x63, 0x70, 0x1a, 0x32, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, - 0x2e, 0x62, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x52, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x73, 0x74, 0x42, 0x79, 0x41, 0x63, 0x70, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0xa2, 0x01, 0x0a, 0x22, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x52, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x73, 0x74, 0x42, 0x79, 0x54, 0x68, 0x72, - 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, - 0x39, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x62, 0x75, 0x6c, 0x6c, - 0x65, 0x74, 0x69, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x69, - 0x6e, 0x67, 0x50, 0x6f, 0x73, 0x74, 0x42, 0x79, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, - 0x64, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0x41, 0x2e, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x62, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x2e, - 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x73, - 0x74, 0x42, 0x79, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x53, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6f, 0x0a, - 0x11, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x12, 0x28, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x62, + 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x1a, 0x30, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x62, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x1a, 0x30, 0x2e, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x62, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x69, - 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, - 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x69, - 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, - 0x72, 0x12, 0x26, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x62, 0x75, - 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6c, - 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x1a, 0x2e, 0x2e, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x62, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x2e, 0x4d, - 0x73, 0x67, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x72, 0x0a, 0x12, 0x52, 0x65, 0x6d, - 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, - 0x29, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x62, 0x75, 0x6c, 0x6c, - 0x65, 0x74, 0x69, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6f, - 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x1a, 0x31, 0x2e, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x62, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x2e, - 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, - 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, - 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xaf, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x62, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x42, - 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x23, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x62, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0xa2, - 0x02, 0x03, 0x53, 0x42, 0x58, 0xaa, 0x02, 0x12, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, - 0x62, 0x2e, 0x42, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0xca, 0x02, 0x12, 0x53, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x5c, 0x42, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0xe2, - 0x02, 0x1e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x5c, 0x42, 0x75, 0x6c, 0x6c, - 0x65, 0x74, 0x69, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x13, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x3a, 0x3a, 0x42, 0x75, - 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x69, 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6c, 0x6c, 0x61, + 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x26, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x68, 0x75, 0x62, 0x2e, 0x62, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x2e, 0x4d, 0x73, 0x67, + 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x1a, + 0x2e, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x62, 0x75, 0x6c, 0x6c, + 0x65, 0x74, 0x69, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6c, 0x6c, 0x61, + 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x72, 0x0a, 0x12, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x29, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, + 0x62, 0x2e, 0x62, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, + 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, + 0x1a, 0x31, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x62, 0x75, 0x6c, + 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, + 0x6f, 0x6c, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xaf, 0x01, 0x0a, 0x16, 0x63, + 0x6f, 0x6d, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x62, 0x75, 0x6c, + 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x62, 0x75, 0x6c, + 0x6c, 0x65, 0x74, 0x69, 0x6e, 0xa2, 0x02, 0x03, 0x53, 0x42, 0x58, 0xaa, 0x02, 0x12, 0x53, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x42, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, + 0xca, 0x02, 0x12, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x5c, 0x42, 0x75, 0x6c, + 0x6c, 0x65, 0x74, 0x69, 0x6e, 0xe2, 0x02, 0x1e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, + 0x62, 0x5c, 0x42, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, + 0x75, 0x62, 0x3a, 0x3a, 0x42, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x69, 0x6e, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -8792,45 +5256,36 @@ func file_sourcehub_bulletin_tx_proto_rawDescGZIP() []byte { return file_sourcehub_bulletin_tx_proto_rawDescData } -var file_sourcehub_bulletin_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_sourcehub_bulletin_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_sourcehub_bulletin_tx_proto_goTypes = []interface{}{ - (*MsgUpdateParams)(nil), // 0: sourcehub.bulletin.MsgUpdateParams - (*MsgUpdateParamsResponse)(nil), // 1: sourcehub.bulletin.MsgUpdateParamsResponse - (*MsgCreatePost)(nil), // 2: sourcehub.bulletin.MsgCreatePost - (*MsgCreatePostResponse)(nil), // 3: sourcehub.bulletin.MsgCreatePostResponse - (*MsgUpdateRingPostByAcp)(nil), // 4: sourcehub.bulletin.MsgUpdateRingPostByAcp - (*MsgUpdateRingPostByAcpResponse)(nil), // 5: sourcehub.bulletin.MsgUpdateRingPostByAcpResponse - (*MsgUpdateRingPostByThresholdSignature)(nil), // 6: sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature - (*MsgUpdateRingPostByThresholdSignatureResponse)(nil), // 7: sourcehub.bulletin.MsgUpdateRingPostByThresholdSignatureResponse - (*RingReshareFinalizeSignDoc)(nil), // 8: sourcehub.bulletin.RingReshareFinalizeSignDoc - (*MsgRegisterNamespace)(nil), // 9: sourcehub.bulletin.MsgRegisterNamespace - (*MsgRegisterNamespaceResponse)(nil), // 10: sourcehub.bulletin.MsgRegisterNamespaceResponse - (*MsgAddCollaborator)(nil), // 11: sourcehub.bulletin.MsgAddCollaborator - (*MsgAddCollaboratorResponse)(nil), // 12: sourcehub.bulletin.MsgAddCollaboratorResponse - (*MsgRemoveCollaborator)(nil), // 13: sourcehub.bulletin.MsgRemoveCollaborator - (*MsgRemoveCollaboratorResponse)(nil), // 14: sourcehub.bulletin.MsgRemoveCollaboratorResponse - (*Params)(nil), // 15: sourcehub.bulletin.Params - (*Namespace)(nil), // 16: sourcehub.bulletin.Namespace + (*MsgUpdateParams)(nil), // 0: sourcehub.bulletin.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 1: sourcehub.bulletin.MsgUpdateParamsResponse + (*MsgCreatePost)(nil), // 2: sourcehub.bulletin.MsgCreatePost + (*MsgCreatePostResponse)(nil), // 3: sourcehub.bulletin.MsgCreatePostResponse + (*MsgRegisterNamespace)(nil), // 4: sourcehub.bulletin.MsgRegisterNamespace + (*MsgRegisterNamespaceResponse)(nil), // 5: sourcehub.bulletin.MsgRegisterNamespaceResponse + (*MsgAddCollaborator)(nil), // 6: sourcehub.bulletin.MsgAddCollaborator + (*MsgAddCollaboratorResponse)(nil), // 7: sourcehub.bulletin.MsgAddCollaboratorResponse + (*MsgRemoveCollaborator)(nil), // 8: sourcehub.bulletin.MsgRemoveCollaborator + (*MsgRemoveCollaboratorResponse)(nil), // 9: sourcehub.bulletin.MsgRemoveCollaboratorResponse + (*Params)(nil), // 10: sourcehub.bulletin.Params + (*Namespace)(nil), // 11: sourcehub.bulletin.Namespace } var file_sourcehub_bulletin_tx_proto_depIdxs = []int32{ - 15, // 0: sourcehub.bulletin.MsgUpdateParams.params:type_name -> sourcehub.bulletin.Params - 16, // 1: sourcehub.bulletin.MsgRegisterNamespaceResponse.namespace:type_name -> sourcehub.bulletin.Namespace + 10, // 0: sourcehub.bulletin.MsgUpdateParams.params:type_name -> sourcehub.bulletin.Params + 11, // 1: sourcehub.bulletin.MsgRegisterNamespaceResponse.namespace:type_name -> sourcehub.bulletin.Namespace 0, // 2: sourcehub.bulletin.Msg.UpdateParams:input_type -> sourcehub.bulletin.MsgUpdateParams 2, // 3: sourcehub.bulletin.Msg.CreatePost:input_type -> sourcehub.bulletin.MsgCreatePost - 4, // 4: sourcehub.bulletin.Msg.UpdateRingPostByAcp:input_type -> sourcehub.bulletin.MsgUpdateRingPostByAcp - 6, // 5: sourcehub.bulletin.Msg.UpdateRingPostByThresholdSignature:input_type -> sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature - 9, // 6: sourcehub.bulletin.Msg.RegisterNamespace:input_type -> sourcehub.bulletin.MsgRegisterNamespace - 11, // 7: sourcehub.bulletin.Msg.AddCollaborator:input_type -> sourcehub.bulletin.MsgAddCollaborator - 13, // 8: sourcehub.bulletin.Msg.RemoveCollaborator:input_type -> sourcehub.bulletin.MsgRemoveCollaborator - 1, // 9: sourcehub.bulletin.Msg.UpdateParams:output_type -> sourcehub.bulletin.MsgUpdateParamsResponse - 3, // 10: sourcehub.bulletin.Msg.CreatePost:output_type -> sourcehub.bulletin.MsgCreatePostResponse - 5, // 11: sourcehub.bulletin.Msg.UpdateRingPostByAcp:output_type -> sourcehub.bulletin.MsgUpdateRingPostByAcpResponse - 7, // 12: sourcehub.bulletin.Msg.UpdateRingPostByThresholdSignature:output_type -> sourcehub.bulletin.MsgUpdateRingPostByThresholdSignatureResponse - 10, // 13: sourcehub.bulletin.Msg.RegisterNamespace:output_type -> sourcehub.bulletin.MsgRegisterNamespaceResponse - 12, // 14: sourcehub.bulletin.Msg.AddCollaborator:output_type -> sourcehub.bulletin.MsgAddCollaboratorResponse - 14, // 15: sourcehub.bulletin.Msg.RemoveCollaborator:output_type -> sourcehub.bulletin.MsgRemoveCollaboratorResponse - 9, // [9:16] is the sub-list for method output_type - 2, // [2:9] is the sub-list for method input_type + 4, // 4: sourcehub.bulletin.Msg.RegisterNamespace:input_type -> sourcehub.bulletin.MsgRegisterNamespace + 6, // 5: sourcehub.bulletin.Msg.AddCollaborator:input_type -> sourcehub.bulletin.MsgAddCollaborator + 8, // 6: sourcehub.bulletin.Msg.RemoveCollaborator:input_type -> sourcehub.bulletin.MsgRemoveCollaborator + 1, // 7: sourcehub.bulletin.Msg.UpdateParams:output_type -> sourcehub.bulletin.MsgUpdateParamsResponse + 3, // 8: sourcehub.bulletin.Msg.CreatePost:output_type -> sourcehub.bulletin.MsgCreatePostResponse + 5, // 9: sourcehub.bulletin.Msg.RegisterNamespace:output_type -> sourcehub.bulletin.MsgRegisterNamespaceResponse + 7, // 10: sourcehub.bulletin.Msg.AddCollaborator:output_type -> sourcehub.bulletin.MsgAddCollaboratorResponse + 9, // 11: sourcehub.bulletin.Msg.RemoveCollaborator:output_type -> sourcehub.bulletin.MsgRemoveCollaboratorResponse + 7, // [7:12] is the sub-list for method output_type + 2, // [2:7] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name 2, // [2:2] is the sub-list for extension extendee 0, // [0:2] is the sub-list for field type_name @@ -8841,8 +5296,8 @@ func file_sourcehub_bulletin_tx_proto_init() { if File_sourcehub_bulletin_tx_proto != nil { return } - file_sourcehub_bulletin_params_proto_init() file_sourcehub_bulletin_namespace_proto_init() + file_sourcehub_bulletin_params_proto_init() if !protoimpl.UnsafeEnabled { file_sourcehub_bulletin_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgUpdateParams); i { @@ -8893,66 +5348,6 @@ func file_sourcehub_bulletin_tx_proto_init() { } } file_sourcehub_bulletin_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgUpdateRingPostByAcp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_sourcehub_bulletin_tx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgUpdateRingPostByAcpResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_sourcehub_bulletin_tx_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgUpdateRingPostByThresholdSignature); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_sourcehub_bulletin_tx_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgUpdateRingPostByThresholdSignatureResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_sourcehub_bulletin_tx_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RingReshareFinalizeSignDoc); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_sourcehub_bulletin_tx_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgRegisterNamespace); i { case 0: return &v.state @@ -8964,7 +5359,7 @@ func file_sourcehub_bulletin_tx_proto_init() { return nil } } - file_sourcehub_bulletin_tx_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_sourcehub_bulletin_tx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgRegisterNamespaceResponse); i { case 0: return &v.state @@ -8976,7 +5371,7 @@ func file_sourcehub_bulletin_tx_proto_init() { return nil } } - file_sourcehub_bulletin_tx_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_sourcehub_bulletin_tx_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgAddCollaborator); i { case 0: return &v.state @@ -8988,7 +5383,7 @@ func file_sourcehub_bulletin_tx_proto_init() { return nil } } - file_sourcehub_bulletin_tx_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_sourcehub_bulletin_tx_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgAddCollaboratorResponse); i { case 0: return &v.state @@ -9000,7 +5395,7 @@ func file_sourcehub_bulletin_tx_proto_init() { return nil } } - file_sourcehub_bulletin_tx_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_sourcehub_bulletin_tx_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgRemoveCollaborator); i { case 0: return &v.state @@ -9012,7 +5407,7 @@ func file_sourcehub_bulletin_tx_proto_init() { return nil } } - file_sourcehub_bulletin_tx_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_sourcehub_bulletin_tx_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MsgRemoveCollaboratorResponse); i { case 0: return &v.state @@ -9025,14 +5420,13 @@ func file_sourcehub_bulletin_tx_proto_init() { } } } - file_sourcehub_bulletin_tx_proto_msgTypes[4].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_sourcehub_bulletin_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 15, + NumMessages: 10, NumExtensions: 0, NumServices: 1, }, diff --git a/api/sourcehub/bulletin/tx_grpc.pb.go b/api/sourcehub/bulletin/tx_grpc.pb.go index e7e165a1..c6dedd8d 100644 --- a/api/sourcehub/bulletin/tx_grpc.pb.go +++ b/api/sourcehub/bulletin/tx_grpc.pb.go @@ -19,13 +19,11 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - Msg_UpdateParams_FullMethodName = "/sourcehub.bulletin.Msg/UpdateParams" - Msg_CreatePost_FullMethodName = "/sourcehub.bulletin.Msg/CreatePost" - Msg_UpdateRingPostByAcp_FullMethodName = "/sourcehub.bulletin.Msg/UpdateRingPostByAcp" - Msg_UpdateRingPostByThresholdSignature_FullMethodName = "/sourcehub.bulletin.Msg/UpdateRingPostByThresholdSignature" - Msg_RegisterNamespace_FullMethodName = "/sourcehub.bulletin.Msg/RegisterNamespace" - Msg_AddCollaborator_FullMethodName = "/sourcehub.bulletin.Msg/AddCollaborator" - Msg_RemoveCollaborator_FullMethodName = "/sourcehub.bulletin.Msg/RemoveCollaborator" + Msg_UpdateParams_FullMethodName = "/sourcehub.bulletin.Msg/UpdateParams" + Msg_CreatePost_FullMethodName = "/sourcehub.bulletin.Msg/CreatePost" + Msg_RegisterNamespace_FullMethodName = "/sourcehub.bulletin.Msg/RegisterNamespace" + Msg_AddCollaborator_FullMethodName = "/sourcehub.bulletin.Msg/AddCollaborator" + Msg_RemoveCollaborator_FullMethodName = "/sourcehub.bulletin.Msg/RemoveCollaborator" ) // MsgClient is the client API for Msg service. @@ -38,8 +36,6 @@ type MsgClient interface { // parameters. The authority defaults to the x/gov module account. UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) CreatePost(ctx context.Context, in *MsgCreatePost, opts ...grpc.CallOption) (*MsgCreatePostResponse, error) - UpdateRingPostByAcp(ctx context.Context, in *MsgUpdateRingPostByAcp, opts ...grpc.CallOption) (*MsgUpdateRingPostByAcpResponse, error) - UpdateRingPostByThresholdSignature(ctx context.Context, in *MsgUpdateRingPostByThresholdSignature, opts ...grpc.CallOption) (*MsgUpdateRingPostByThresholdSignatureResponse, error) RegisterNamespace(ctx context.Context, in *MsgRegisterNamespace, opts ...grpc.CallOption) (*MsgRegisterNamespaceResponse, error) AddCollaborator(ctx context.Context, in *MsgAddCollaborator, opts ...grpc.CallOption) (*MsgAddCollaboratorResponse, error) RemoveCollaborator(ctx context.Context, in *MsgRemoveCollaborator, opts ...grpc.CallOption) (*MsgRemoveCollaboratorResponse, error) @@ -73,26 +69,6 @@ func (c *msgClient) CreatePost(ctx context.Context, in *MsgCreatePost, opts ...g return out, nil } -func (c *msgClient) UpdateRingPostByAcp(ctx context.Context, in *MsgUpdateRingPostByAcp, opts ...grpc.CallOption) (*MsgUpdateRingPostByAcpResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgUpdateRingPostByAcpResponse) - err := c.cc.Invoke(ctx, Msg_UpdateRingPostByAcp_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) UpdateRingPostByThresholdSignature(ctx context.Context, in *MsgUpdateRingPostByThresholdSignature, opts ...grpc.CallOption) (*MsgUpdateRingPostByThresholdSignatureResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(MsgUpdateRingPostByThresholdSignatureResponse) - err := c.cc.Invoke(ctx, Msg_UpdateRingPostByThresholdSignature_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *msgClient) RegisterNamespace(ctx context.Context, in *MsgRegisterNamespace, opts ...grpc.CallOption) (*MsgRegisterNamespaceResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgRegisterNamespaceResponse) @@ -133,8 +109,6 @@ type MsgServer interface { // parameters. The authority defaults to the x/gov module account. UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) CreatePost(context.Context, *MsgCreatePost) (*MsgCreatePostResponse, error) - UpdateRingPostByAcp(context.Context, *MsgUpdateRingPostByAcp) (*MsgUpdateRingPostByAcpResponse, error) - UpdateRingPostByThresholdSignature(context.Context, *MsgUpdateRingPostByThresholdSignature) (*MsgUpdateRingPostByThresholdSignatureResponse, error) RegisterNamespace(context.Context, *MsgRegisterNamespace) (*MsgRegisterNamespaceResponse, error) AddCollaborator(context.Context, *MsgAddCollaborator) (*MsgAddCollaboratorResponse, error) RemoveCollaborator(context.Context, *MsgRemoveCollaborator) (*MsgRemoveCollaboratorResponse, error) @@ -154,12 +128,6 @@ func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (* func (UnimplementedMsgServer) CreatePost(context.Context, *MsgCreatePost) (*MsgCreatePostResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreatePost not implemented") } -func (UnimplementedMsgServer) UpdateRingPostByAcp(context.Context, *MsgUpdateRingPostByAcp) (*MsgUpdateRingPostByAcpResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateRingPostByAcp not implemented") -} -func (UnimplementedMsgServer) UpdateRingPostByThresholdSignature(context.Context, *MsgUpdateRingPostByThresholdSignature) (*MsgUpdateRingPostByThresholdSignatureResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateRingPostByThresholdSignature not implemented") -} func (UnimplementedMsgServer) RegisterNamespace(context.Context, *MsgRegisterNamespace) (*MsgRegisterNamespaceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RegisterNamespace not implemented") } @@ -226,42 +194,6 @@ func _Msg_CreatePost_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } -func _Msg_UpdateRingPostByAcp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateRingPostByAcp) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateRingPostByAcp(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_UpdateRingPostByAcp_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateRingPostByAcp(ctx, req.(*MsgUpdateRingPostByAcp)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UpdateRingPostByThresholdSignature_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateRingPostByThresholdSignature) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateRingPostByThresholdSignature(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_UpdateRingPostByThresholdSignature_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateRingPostByThresholdSignature(ctx, req.(*MsgUpdateRingPostByThresholdSignature)) - } - return interceptor(ctx, in, info, handler) -} - func _Msg_RegisterNamespace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgRegisterNamespace) if err := dec(in); err != nil { @@ -331,14 +263,6 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "CreatePost", Handler: _Msg_CreatePost_Handler, }, - { - MethodName: "UpdateRingPostByAcp", - Handler: _Msg_UpdateRingPostByAcp_Handler, - }, - { - MethodName: "UpdateRingPostByThresholdSignature", - Handler: _Msg_UpdateRingPostByThresholdSignature_Handler, - }, { MethodName: "RegisterNamespace", Handler: _Msg_RegisterNamespace_Handler, diff --git a/api/sourcehub/orbis/document.pb.go b/api/sourcehub/orbis/document.pb.go new file mode 100644 index 00000000..fb0a77a4 --- /dev/null +++ b/api/sourcehub/orbis/document.pb.go @@ -0,0 +1,215 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc (unknown) +// source: sourcehub/orbis/document.proto + +package orbis + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Document stores an encrypted Orbis document and its policy binding metadata. +type Document struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + CreatorDid string `protobuf:"bytes,2,opt,name=creator_did,json=creatorDid,proto3" json:"creator_did,omitempty"` + RingId string `protobuf:"bytes,3,opt,name=ring_id,json=ringId,proto3" json:"ring_id,omitempty"` + Document string `protobuf:"bytes,4,opt,name=document,proto3" json:"document,omitempty"` + Proof string `protobuf:"bytes,5,opt,name=proof,proto3" json:"proof,omitempty"` + PolicyId string `protobuf:"bytes,6,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"` + Resource string `protobuf:"bytes,7,opt,name=resource,proto3" json:"resource,omitempty"` + Permission string `protobuf:"bytes,8,opt,name=permission,proto3" json:"permission,omitempty"` + // Absent means no tier. + Tier *string `protobuf:"bytes,9,opt,name=tier,proto3,oneof" json:"tier,omitempty"` + // Absent means no timestamp. + Timestamp *uint64 `protobuf:"varint,10,opt,name=timestamp,proto3,oneof" json:"timestamp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Document) Reset() { + *x = Document{} + mi := &file_sourcehub_orbis_document_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Document) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Document) ProtoMessage() {} + +func (x *Document) ProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_document_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Document.ProtoReflect.Descriptor instead. +func (*Document) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_document_proto_rawDescGZIP(), []int{0} +} + +func (x *Document) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Document) GetCreatorDid() string { + if x != nil { + return x.CreatorDid + } + return "" +} + +func (x *Document) GetRingId() string { + if x != nil { + return x.RingId + } + return "" +} + +func (x *Document) GetDocument() string { + if x != nil { + return x.Document + } + return "" +} + +func (x *Document) GetProof() string { + if x != nil { + return x.Proof + } + return "" +} + +func (x *Document) GetPolicyId() string { + if x != nil { + return x.PolicyId + } + return "" +} + +func (x *Document) GetResource() string { + if x != nil { + return x.Resource + } + return "" +} + +func (x *Document) GetPermission() string { + if x != nil { + return x.Permission + } + return "" +} + +func (x *Document) GetTier() string { + if x != nil && x.Tier != nil { + return *x.Tier + } + return "" +} + +func (x *Document) GetTimestamp() uint64 { + if x != nil && x.Timestamp != nil { + return *x.Timestamp + } + return 0 +} + +var File_sourcehub_orbis_document_proto protoreflect.FileDescriptor + +const file_sourcehub_orbis_document_proto_rawDesc = "" + + "\n" + + "\x1esourcehub/orbis/document.proto\x12\x0fsourcehub.orbis\"\xb2\x02\n" + + "\bDocument\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x1f\n" + + "\vcreator_did\x18\x02 \x01(\tR\n" + + "creatorDid\x12\x17\n" + + "\aring_id\x18\x03 \x01(\tR\x06ringId\x12\x1a\n" + + "\bdocument\x18\x04 \x01(\tR\bdocument\x12\x14\n" + + "\x05proof\x18\x05 \x01(\tR\x05proof\x12\x1b\n" + + "\tpolicy_id\x18\x06 \x01(\tR\bpolicyId\x12\x1a\n" + + "\bresource\x18\a \x01(\tR\bresource\x12\x1e\n" + + "\n" + + "permission\x18\b \x01(\tR\n" + + "permission\x12\x17\n" + + "\x04tier\x18\t \x01(\tH\x00R\x04tier\x88\x01\x01\x12!\n" + + "\ttimestamp\x18\n" + + " \x01(\x04H\x01R\ttimestamp\x88\x01\x01B\a\n" + + "\x05_tierB\f\n" + + "\n" + + "_timestampB\xa3\x01\n" + + "\x13com.sourcehub.orbisB\rDocumentProtoP\x01Z cosmossdk.io/api/sourcehub/orbis\xa2\x02\x03SOX\xaa\x02\x0fSourcehub.Orbis\xca\x02\x0fSourcehub\\Orbis\xe2\x02\x1bSourcehub\\Orbis\\GPBMetadata\xea\x02\x10Sourcehub::Orbisb\x06proto3" + +var ( + file_sourcehub_orbis_document_proto_rawDescOnce sync.Once + file_sourcehub_orbis_document_proto_rawDescData []byte +) + +func file_sourcehub_orbis_document_proto_rawDescGZIP() []byte { + file_sourcehub_orbis_document_proto_rawDescOnce.Do(func() { + file_sourcehub_orbis_document_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_sourcehub_orbis_document_proto_rawDesc), len(file_sourcehub_orbis_document_proto_rawDesc))) + }) + return file_sourcehub_orbis_document_proto_rawDescData +} + +var file_sourcehub_orbis_document_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_sourcehub_orbis_document_proto_goTypes = []any{ + (*Document)(nil), // 0: sourcehub.orbis.Document +} +var file_sourcehub_orbis_document_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_sourcehub_orbis_document_proto_init() } +func file_sourcehub_orbis_document_proto_init() { + if File_sourcehub_orbis_document_proto != nil { + return + } + file_sourcehub_orbis_document_proto_msgTypes[0].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_sourcehub_orbis_document_proto_rawDesc), len(file_sourcehub_orbis_document_proto_rawDesc)), + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_sourcehub_orbis_document_proto_goTypes, + DependencyIndexes: file_sourcehub_orbis_document_proto_depIdxs, + MessageInfos: file_sourcehub_orbis_document_proto_msgTypes, + }.Build() + File_sourcehub_orbis_document_proto = out.File + file_sourcehub_orbis_document_proto_goTypes = nil + file_sourcehub_orbis_document_proto_depIdxs = nil +} diff --git a/api/sourcehub/orbis/events.pulsar.go b/api/sourcehub/orbis/events.pulsar.go new file mode 100644 index 00000000..90274e60 --- /dev/null +++ b/api/sourcehub/orbis/events.pulsar.go @@ -0,0 +1,3919 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package orbis + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_EventRingCreated protoreflect.MessageDescriptor + fd_EventRingCreated_ring_id protoreflect.FieldDescriptor + fd_EventRingCreated_creator_did protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_events_proto_init() + md_EventRingCreated = File_sourcehub_orbis_events_proto.Messages().ByName("EventRingCreated") + fd_EventRingCreated_ring_id = md_EventRingCreated.Fields().ByName("ring_id") + fd_EventRingCreated_creator_did = md_EventRingCreated.Fields().ByName("creator_did") +} + +var _ protoreflect.Message = (*fastReflection_EventRingCreated)(nil) + +type fastReflection_EventRingCreated EventRingCreated + +func (x *EventRingCreated) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventRingCreated)(x) +} + +func (x *EventRingCreated) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_events_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventRingCreated_messageType fastReflection_EventRingCreated_messageType +var _ protoreflect.MessageType = fastReflection_EventRingCreated_messageType{} + +type fastReflection_EventRingCreated_messageType struct{} + +func (x fastReflection_EventRingCreated_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventRingCreated)(nil) +} +func (x fastReflection_EventRingCreated_messageType) New() protoreflect.Message { + return new(fastReflection_EventRingCreated) +} +func (x fastReflection_EventRingCreated_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventRingCreated +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventRingCreated) Descriptor() protoreflect.MessageDescriptor { + return md_EventRingCreated +} + +// 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_EventRingCreated) Type() protoreflect.MessageType { + return _fastReflection_EventRingCreated_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventRingCreated) New() protoreflect.Message { + return new(fastReflection_EventRingCreated) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventRingCreated) Interface() protoreflect.ProtoMessage { + return (*EventRingCreated)(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_EventRingCreated) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.RingId != "" { + value := protoreflect.ValueOfString(x.RingId) + if !f(fd_EventRingCreated_ring_id, value) { + return + } + } + if x.CreatorDid != "" { + value := protoreflect.ValueOfString(x.CreatorDid) + if !f(fd_EventRingCreated_creator_did, 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_EventRingCreated) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.EventRingCreated.ring_id": + return x.RingId != "" + case "sourcehub.orbis.EventRingCreated.creator_did": + return x.CreatorDid != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventRingCreated")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventRingCreated 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_EventRingCreated) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.EventRingCreated.ring_id": + x.RingId = "" + case "sourcehub.orbis.EventRingCreated.creator_did": + x.CreatorDid = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventRingCreated")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventRingCreated 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_EventRingCreated) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.EventRingCreated.ring_id": + value := x.RingId + return protoreflect.ValueOfString(value) + case "sourcehub.orbis.EventRingCreated.creator_did": + value := x.CreatorDid + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventRingCreated")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventRingCreated 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_EventRingCreated) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.EventRingCreated.ring_id": + x.RingId = value.Interface().(string) + case "sourcehub.orbis.EventRingCreated.creator_did": + x.CreatorDid = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventRingCreated")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventRingCreated 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_EventRingCreated) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.EventRingCreated.ring_id": + panic(fmt.Errorf("field ring_id of message sourcehub.orbis.EventRingCreated is not mutable")) + case "sourcehub.orbis.EventRingCreated.creator_did": + panic(fmt.Errorf("field creator_did of message sourcehub.orbis.EventRingCreated is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventRingCreated")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventRingCreated 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_EventRingCreated) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.EventRingCreated.ring_id": + return protoreflect.ValueOfString("") + case "sourcehub.orbis.EventRingCreated.creator_did": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventRingCreated")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventRingCreated 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_EventRingCreated) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.EventRingCreated", 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_EventRingCreated) 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_EventRingCreated) 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_EventRingCreated) 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_EventRingCreated) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventRingCreated) + 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.RingId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.CreatorDid) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventRingCreated) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.CreatorDid) > 0 { + i -= len(x.CreatorDid) + copy(dAtA[i:], x.CreatorDid) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CreatorDid))) + i-- + dAtA[i] = 0x12 + } + if len(x.RingId) > 0 { + i -= len(x.RingId) + copy(dAtA[i:], x.RingId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.RingId))) + 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().(*EventRingCreated) + 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: EventRingCreated: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventRingCreated: 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 RingId", 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.RingId = 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 CreatorDid", 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.CreatorDid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_EventRingUpdated protoreflect.MessageDescriptor + fd_EventRingUpdated_ring_id protoreflect.FieldDescriptor + fd_EventRingUpdated_updater_did protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_events_proto_init() + md_EventRingUpdated = File_sourcehub_orbis_events_proto.Messages().ByName("EventRingUpdated") + fd_EventRingUpdated_ring_id = md_EventRingUpdated.Fields().ByName("ring_id") + fd_EventRingUpdated_updater_did = md_EventRingUpdated.Fields().ByName("updater_did") +} + +var _ protoreflect.Message = (*fastReflection_EventRingUpdated)(nil) + +type fastReflection_EventRingUpdated EventRingUpdated + +func (x *EventRingUpdated) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventRingUpdated)(x) +} + +func (x *EventRingUpdated) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_events_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventRingUpdated_messageType fastReflection_EventRingUpdated_messageType +var _ protoreflect.MessageType = fastReflection_EventRingUpdated_messageType{} + +type fastReflection_EventRingUpdated_messageType struct{} + +func (x fastReflection_EventRingUpdated_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventRingUpdated)(nil) +} +func (x fastReflection_EventRingUpdated_messageType) New() protoreflect.Message { + return new(fastReflection_EventRingUpdated) +} +func (x fastReflection_EventRingUpdated_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventRingUpdated +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventRingUpdated) Descriptor() protoreflect.MessageDescriptor { + return md_EventRingUpdated +} + +// 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_EventRingUpdated) Type() protoreflect.MessageType { + return _fastReflection_EventRingUpdated_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventRingUpdated) New() protoreflect.Message { + return new(fastReflection_EventRingUpdated) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventRingUpdated) Interface() protoreflect.ProtoMessage { + return (*EventRingUpdated)(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_EventRingUpdated) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.RingId != "" { + value := protoreflect.ValueOfString(x.RingId) + if !f(fd_EventRingUpdated_ring_id, value) { + return + } + } + if x.UpdaterDid != "" { + value := protoreflect.ValueOfString(x.UpdaterDid) + if !f(fd_EventRingUpdated_updater_did, 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_EventRingUpdated) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.EventRingUpdated.ring_id": + return x.RingId != "" + case "sourcehub.orbis.EventRingUpdated.updater_did": + return x.UpdaterDid != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventRingUpdated")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventRingUpdated 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_EventRingUpdated) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.EventRingUpdated.ring_id": + x.RingId = "" + case "sourcehub.orbis.EventRingUpdated.updater_did": + x.UpdaterDid = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventRingUpdated")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventRingUpdated 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_EventRingUpdated) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.EventRingUpdated.ring_id": + value := x.RingId + return protoreflect.ValueOfString(value) + case "sourcehub.orbis.EventRingUpdated.updater_did": + value := x.UpdaterDid + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventRingUpdated")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventRingUpdated 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_EventRingUpdated) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.EventRingUpdated.ring_id": + x.RingId = value.Interface().(string) + case "sourcehub.orbis.EventRingUpdated.updater_did": + x.UpdaterDid = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventRingUpdated")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventRingUpdated 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_EventRingUpdated) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.EventRingUpdated.ring_id": + panic(fmt.Errorf("field ring_id of message sourcehub.orbis.EventRingUpdated is not mutable")) + case "sourcehub.orbis.EventRingUpdated.updater_did": + panic(fmt.Errorf("field updater_did of message sourcehub.orbis.EventRingUpdated is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventRingUpdated")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventRingUpdated 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_EventRingUpdated) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.EventRingUpdated.ring_id": + return protoreflect.ValueOfString("") + case "sourcehub.orbis.EventRingUpdated.updater_did": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventRingUpdated")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventRingUpdated 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_EventRingUpdated) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.EventRingUpdated", 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_EventRingUpdated) 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_EventRingUpdated) 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_EventRingUpdated) 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_EventRingUpdated) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventRingUpdated) + 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.RingId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.UpdaterDid) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventRingUpdated) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.UpdaterDid) > 0 { + i -= len(x.UpdaterDid) + copy(dAtA[i:], x.UpdaterDid) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.UpdaterDid))) + i-- + dAtA[i] = 0x12 + } + if len(x.RingId) > 0 { + i -= len(x.RingId) + copy(dAtA[i:], x.RingId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.RingId))) + 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().(*EventRingUpdated) + 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: EventRingUpdated: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventRingUpdated: 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 RingId", 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.RingId = 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 UpdaterDid", 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.UpdaterDid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_EventDocumentStored protoreflect.MessageDescriptor + fd_EventDocumentStored_document_id protoreflect.FieldDescriptor + fd_EventDocumentStored_creator_did protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_events_proto_init() + md_EventDocumentStored = File_sourcehub_orbis_events_proto.Messages().ByName("EventDocumentStored") + fd_EventDocumentStored_document_id = md_EventDocumentStored.Fields().ByName("document_id") + fd_EventDocumentStored_creator_did = md_EventDocumentStored.Fields().ByName("creator_did") +} + +var _ protoreflect.Message = (*fastReflection_EventDocumentStored)(nil) + +type fastReflection_EventDocumentStored EventDocumentStored + +func (x *EventDocumentStored) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventDocumentStored)(x) +} + +func (x *EventDocumentStored) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_events_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_EventDocumentStored_messageType fastReflection_EventDocumentStored_messageType +var _ protoreflect.MessageType = fastReflection_EventDocumentStored_messageType{} + +type fastReflection_EventDocumentStored_messageType struct{} + +func (x fastReflection_EventDocumentStored_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventDocumentStored)(nil) +} +func (x fastReflection_EventDocumentStored_messageType) New() protoreflect.Message { + return new(fastReflection_EventDocumentStored) +} +func (x fastReflection_EventDocumentStored_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventDocumentStored +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventDocumentStored) Descriptor() protoreflect.MessageDescriptor { + return md_EventDocumentStored +} + +// 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_EventDocumentStored) Type() protoreflect.MessageType { + return _fastReflection_EventDocumentStored_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventDocumentStored) New() protoreflect.Message { + return new(fastReflection_EventDocumentStored) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventDocumentStored) Interface() protoreflect.ProtoMessage { + return (*EventDocumentStored)(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_EventDocumentStored) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.DocumentId != "" { + value := protoreflect.ValueOfString(x.DocumentId) + if !f(fd_EventDocumentStored_document_id, value) { + return + } + } + if x.CreatorDid != "" { + value := protoreflect.ValueOfString(x.CreatorDid) + if !f(fd_EventDocumentStored_creator_did, 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_EventDocumentStored) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.EventDocumentStored.document_id": + return x.DocumentId != "" + case "sourcehub.orbis.EventDocumentStored.creator_did": + return x.CreatorDid != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventDocumentStored")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventDocumentStored 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_EventDocumentStored) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.EventDocumentStored.document_id": + x.DocumentId = "" + case "sourcehub.orbis.EventDocumentStored.creator_did": + x.CreatorDid = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventDocumentStored")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventDocumentStored 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_EventDocumentStored) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.EventDocumentStored.document_id": + value := x.DocumentId + return protoreflect.ValueOfString(value) + case "sourcehub.orbis.EventDocumentStored.creator_did": + value := x.CreatorDid + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventDocumentStored")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventDocumentStored 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_EventDocumentStored) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.EventDocumentStored.document_id": + x.DocumentId = value.Interface().(string) + case "sourcehub.orbis.EventDocumentStored.creator_did": + x.CreatorDid = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventDocumentStored")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventDocumentStored 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_EventDocumentStored) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.EventDocumentStored.document_id": + panic(fmt.Errorf("field document_id of message sourcehub.orbis.EventDocumentStored is not mutable")) + case "sourcehub.orbis.EventDocumentStored.creator_did": + panic(fmt.Errorf("field creator_did of message sourcehub.orbis.EventDocumentStored is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventDocumentStored")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventDocumentStored 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_EventDocumentStored) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.EventDocumentStored.document_id": + return protoreflect.ValueOfString("") + case "sourcehub.orbis.EventDocumentStored.creator_did": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventDocumentStored")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventDocumentStored 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_EventDocumentStored) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.EventDocumentStored", 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_EventDocumentStored) 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_EventDocumentStored) 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_EventDocumentStored) 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_EventDocumentStored) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventDocumentStored) + 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.DocumentId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.CreatorDid) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventDocumentStored) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.CreatorDid) > 0 { + i -= len(x.CreatorDid) + copy(dAtA[i:], x.CreatorDid) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CreatorDid))) + i-- + dAtA[i] = 0x12 + } + if len(x.DocumentId) > 0 { + i -= len(x.DocumentId) + copy(dAtA[i:], x.DocumentId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DocumentId))) + 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().(*EventDocumentStored) + 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: EventDocumentStored: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventDocumentStored: 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 DocumentId", 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.DocumentId = 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 CreatorDid", 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.CreatorDid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_EventKeyDerivationStored protoreflect.MessageDescriptor + fd_EventKeyDerivationStored_key_derivation_id protoreflect.FieldDescriptor + fd_EventKeyDerivationStored_creator_did protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_events_proto_init() + md_EventKeyDerivationStored = File_sourcehub_orbis_events_proto.Messages().ByName("EventKeyDerivationStored") + fd_EventKeyDerivationStored_key_derivation_id = md_EventKeyDerivationStored.Fields().ByName("key_derivation_id") + fd_EventKeyDerivationStored_creator_did = md_EventKeyDerivationStored.Fields().ByName("creator_did") +} + +var _ protoreflect.Message = (*fastReflection_EventKeyDerivationStored)(nil) + +type fastReflection_EventKeyDerivationStored EventKeyDerivationStored + +func (x *EventKeyDerivationStored) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventKeyDerivationStored)(x) +} + +func (x *EventKeyDerivationStored) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_events_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventKeyDerivationStored_messageType fastReflection_EventKeyDerivationStored_messageType +var _ protoreflect.MessageType = fastReflection_EventKeyDerivationStored_messageType{} + +type fastReflection_EventKeyDerivationStored_messageType struct{} + +func (x fastReflection_EventKeyDerivationStored_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventKeyDerivationStored)(nil) +} +func (x fastReflection_EventKeyDerivationStored_messageType) New() protoreflect.Message { + return new(fastReflection_EventKeyDerivationStored) +} +func (x fastReflection_EventKeyDerivationStored_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventKeyDerivationStored +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventKeyDerivationStored) Descriptor() protoreflect.MessageDescriptor { + return md_EventKeyDerivationStored +} + +// 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_EventKeyDerivationStored) Type() protoreflect.MessageType { + return _fastReflection_EventKeyDerivationStored_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventKeyDerivationStored) New() protoreflect.Message { + return new(fastReflection_EventKeyDerivationStored) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventKeyDerivationStored) Interface() protoreflect.ProtoMessage { + return (*EventKeyDerivationStored)(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_EventKeyDerivationStored) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.KeyDerivationId != "" { + value := protoreflect.ValueOfString(x.KeyDerivationId) + if !f(fd_EventKeyDerivationStored_key_derivation_id, value) { + return + } + } + if x.CreatorDid != "" { + value := protoreflect.ValueOfString(x.CreatorDid) + if !f(fd_EventKeyDerivationStored_creator_did, 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_EventKeyDerivationStored) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.EventKeyDerivationStored.key_derivation_id": + return x.KeyDerivationId != "" + case "sourcehub.orbis.EventKeyDerivationStored.creator_did": + return x.CreatorDid != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventKeyDerivationStored")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventKeyDerivationStored 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_EventKeyDerivationStored) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.EventKeyDerivationStored.key_derivation_id": + x.KeyDerivationId = "" + case "sourcehub.orbis.EventKeyDerivationStored.creator_did": + x.CreatorDid = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventKeyDerivationStored")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventKeyDerivationStored 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_EventKeyDerivationStored) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.EventKeyDerivationStored.key_derivation_id": + value := x.KeyDerivationId + return protoreflect.ValueOfString(value) + case "sourcehub.orbis.EventKeyDerivationStored.creator_did": + value := x.CreatorDid + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventKeyDerivationStored")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventKeyDerivationStored 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_EventKeyDerivationStored) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.EventKeyDerivationStored.key_derivation_id": + x.KeyDerivationId = value.Interface().(string) + case "sourcehub.orbis.EventKeyDerivationStored.creator_did": + x.CreatorDid = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventKeyDerivationStored")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventKeyDerivationStored 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_EventKeyDerivationStored) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.EventKeyDerivationStored.key_derivation_id": + panic(fmt.Errorf("field key_derivation_id of message sourcehub.orbis.EventKeyDerivationStored is not mutable")) + case "sourcehub.orbis.EventKeyDerivationStored.creator_did": + panic(fmt.Errorf("field creator_did of message sourcehub.orbis.EventKeyDerivationStored is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventKeyDerivationStored")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventKeyDerivationStored 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_EventKeyDerivationStored) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.EventKeyDerivationStored.key_derivation_id": + return protoreflect.ValueOfString("") + case "sourcehub.orbis.EventKeyDerivationStored.creator_did": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventKeyDerivationStored")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventKeyDerivationStored 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_EventKeyDerivationStored) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.EventKeyDerivationStored", 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_EventKeyDerivationStored) 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_EventKeyDerivationStored) 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_EventKeyDerivationStored) 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_EventKeyDerivationStored) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventKeyDerivationStored) + 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.KeyDerivationId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.CreatorDid) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventKeyDerivationStored) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.CreatorDid) > 0 { + i -= len(x.CreatorDid) + copy(dAtA[i:], x.CreatorDid) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CreatorDid))) + i-- + dAtA[i] = 0x12 + } + if len(x.KeyDerivationId) > 0 { + i -= len(x.KeyDerivationId) + copy(dAtA[i:], x.KeyDerivationId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.KeyDerivationId))) + 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().(*EventKeyDerivationStored) + 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: EventKeyDerivationStored: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventKeyDerivationStored: 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 KeyDerivationId", 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.KeyDerivationId = 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 CreatorDid", 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.CreatorDid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_EventNodeInfoCreated protoreflect.MessageDescriptor + fd_EventNodeInfoCreated_peer_id protoreflect.FieldDescriptor + fd_EventNodeInfoCreated_controller_key protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_events_proto_init() + md_EventNodeInfoCreated = File_sourcehub_orbis_events_proto.Messages().ByName("EventNodeInfoCreated") + fd_EventNodeInfoCreated_peer_id = md_EventNodeInfoCreated.Fields().ByName("peer_id") + fd_EventNodeInfoCreated_controller_key = md_EventNodeInfoCreated.Fields().ByName("controller_key") +} + +var _ protoreflect.Message = (*fastReflection_EventNodeInfoCreated)(nil) + +type fastReflection_EventNodeInfoCreated EventNodeInfoCreated + +func (x *EventNodeInfoCreated) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventNodeInfoCreated)(x) +} + +func (x *EventNodeInfoCreated) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_events_proto_msgTypes[4] + 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_EventNodeInfoCreated_messageType fastReflection_EventNodeInfoCreated_messageType +var _ protoreflect.MessageType = fastReflection_EventNodeInfoCreated_messageType{} + +type fastReflection_EventNodeInfoCreated_messageType struct{} + +func (x fastReflection_EventNodeInfoCreated_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventNodeInfoCreated)(nil) +} +func (x fastReflection_EventNodeInfoCreated_messageType) New() protoreflect.Message { + return new(fastReflection_EventNodeInfoCreated) +} +func (x fastReflection_EventNodeInfoCreated_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventNodeInfoCreated +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventNodeInfoCreated) Descriptor() protoreflect.MessageDescriptor { + return md_EventNodeInfoCreated +} + +// 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_EventNodeInfoCreated) Type() protoreflect.MessageType { + return _fastReflection_EventNodeInfoCreated_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventNodeInfoCreated) New() protoreflect.Message { + return new(fastReflection_EventNodeInfoCreated) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventNodeInfoCreated) Interface() protoreflect.ProtoMessage { + return (*EventNodeInfoCreated)(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_EventNodeInfoCreated) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.PeerId != "" { + value := protoreflect.ValueOfString(x.PeerId) + if !f(fd_EventNodeInfoCreated_peer_id, value) { + return + } + } + if x.ControllerKey != "" { + value := protoreflect.ValueOfString(x.ControllerKey) + if !f(fd_EventNodeInfoCreated_controller_key, 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_EventNodeInfoCreated) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.EventNodeInfoCreated.peer_id": + return x.PeerId != "" + case "sourcehub.orbis.EventNodeInfoCreated.controller_key": + return x.ControllerKey != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventNodeInfoCreated")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventNodeInfoCreated 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_EventNodeInfoCreated) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.EventNodeInfoCreated.peer_id": + x.PeerId = "" + case "sourcehub.orbis.EventNodeInfoCreated.controller_key": + x.ControllerKey = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventNodeInfoCreated")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventNodeInfoCreated 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_EventNodeInfoCreated) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.EventNodeInfoCreated.peer_id": + value := x.PeerId + return protoreflect.ValueOfString(value) + case "sourcehub.orbis.EventNodeInfoCreated.controller_key": + value := x.ControllerKey + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventNodeInfoCreated")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventNodeInfoCreated 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_EventNodeInfoCreated) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.EventNodeInfoCreated.peer_id": + x.PeerId = value.Interface().(string) + case "sourcehub.orbis.EventNodeInfoCreated.controller_key": + x.ControllerKey = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventNodeInfoCreated")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventNodeInfoCreated 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_EventNodeInfoCreated) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.EventNodeInfoCreated.peer_id": + panic(fmt.Errorf("field peer_id of message sourcehub.orbis.EventNodeInfoCreated is not mutable")) + case "sourcehub.orbis.EventNodeInfoCreated.controller_key": + panic(fmt.Errorf("field controller_key of message sourcehub.orbis.EventNodeInfoCreated is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventNodeInfoCreated")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventNodeInfoCreated 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_EventNodeInfoCreated) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.EventNodeInfoCreated.peer_id": + return protoreflect.ValueOfString("") + case "sourcehub.orbis.EventNodeInfoCreated.controller_key": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventNodeInfoCreated")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventNodeInfoCreated 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_EventNodeInfoCreated) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.EventNodeInfoCreated", 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_EventNodeInfoCreated) 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_EventNodeInfoCreated) 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_EventNodeInfoCreated) 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_EventNodeInfoCreated) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventNodeInfoCreated) + 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.PeerId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ControllerKey) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventNodeInfoCreated) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.ControllerKey) > 0 { + i -= len(x.ControllerKey) + copy(dAtA[i:], x.ControllerKey) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ControllerKey))) + i-- + dAtA[i] = 0x12 + } + if len(x.PeerId) > 0 { + i -= len(x.PeerId) + copy(dAtA[i:], x.PeerId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PeerId))) + 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().(*EventNodeInfoCreated) + 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: EventNodeInfoCreated: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventNodeInfoCreated: 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 PeerId", 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.PeerId = 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 ControllerKey", 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.ControllerKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_EventNodeInfoUpdated protoreflect.MessageDescriptor + fd_EventNodeInfoUpdated_peer_id protoreflect.FieldDescriptor + fd_EventNodeInfoUpdated_controller_key protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_events_proto_init() + md_EventNodeInfoUpdated = File_sourcehub_orbis_events_proto.Messages().ByName("EventNodeInfoUpdated") + fd_EventNodeInfoUpdated_peer_id = md_EventNodeInfoUpdated.Fields().ByName("peer_id") + fd_EventNodeInfoUpdated_controller_key = md_EventNodeInfoUpdated.Fields().ByName("controller_key") +} + +var _ protoreflect.Message = (*fastReflection_EventNodeInfoUpdated)(nil) + +type fastReflection_EventNodeInfoUpdated EventNodeInfoUpdated + +func (x *EventNodeInfoUpdated) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventNodeInfoUpdated)(x) +} + +func (x *EventNodeInfoUpdated) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_events_proto_msgTypes[5] + 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_EventNodeInfoUpdated_messageType fastReflection_EventNodeInfoUpdated_messageType +var _ protoreflect.MessageType = fastReflection_EventNodeInfoUpdated_messageType{} + +type fastReflection_EventNodeInfoUpdated_messageType struct{} + +func (x fastReflection_EventNodeInfoUpdated_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventNodeInfoUpdated)(nil) +} +func (x fastReflection_EventNodeInfoUpdated_messageType) New() protoreflect.Message { + return new(fastReflection_EventNodeInfoUpdated) +} +func (x fastReflection_EventNodeInfoUpdated_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventNodeInfoUpdated +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventNodeInfoUpdated) Descriptor() protoreflect.MessageDescriptor { + return md_EventNodeInfoUpdated +} + +// 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_EventNodeInfoUpdated) Type() protoreflect.MessageType { + return _fastReflection_EventNodeInfoUpdated_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventNodeInfoUpdated) New() protoreflect.Message { + return new(fastReflection_EventNodeInfoUpdated) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventNodeInfoUpdated) Interface() protoreflect.ProtoMessage { + return (*EventNodeInfoUpdated)(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_EventNodeInfoUpdated) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.PeerId != "" { + value := protoreflect.ValueOfString(x.PeerId) + if !f(fd_EventNodeInfoUpdated_peer_id, value) { + return + } + } + if x.ControllerKey != "" { + value := protoreflect.ValueOfString(x.ControllerKey) + if !f(fd_EventNodeInfoUpdated_controller_key, 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_EventNodeInfoUpdated) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.EventNodeInfoUpdated.peer_id": + return x.PeerId != "" + case "sourcehub.orbis.EventNodeInfoUpdated.controller_key": + return x.ControllerKey != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventNodeInfoUpdated")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventNodeInfoUpdated 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_EventNodeInfoUpdated) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.EventNodeInfoUpdated.peer_id": + x.PeerId = "" + case "sourcehub.orbis.EventNodeInfoUpdated.controller_key": + x.ControllerKey = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventNodeInfoUpdated")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventNodeInfoUpdated 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_EventNodeInfoUpdated) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.EventNodeInfoUpdated.peer_id": + value := x.PeerId + return protoreflect.ValueOfString(value) + case "sourcehub.orbis.EventNodeInfoUpdated.controller_key": + value := x.ControllerKey + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventNodeInfoUpdated")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventNodeInfoUpdated 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_EventNodeInfoUpdated) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.EventNodeInfoUpdated.peer_id": + x.PeerId = value.Interface().(string) + case "sourcehub.orbis.EventNodeInfoUpdated.controller_key": + x.ControllerKey = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventNodeInfoUpdated")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventNodeInfoUpdated 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_EventNodeInfoUpdated) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.EventNodeInfoUpdated.peer_id": + panic(fmt.Errorf("field peer_id of message sourcehub.orbis.EventNodeInfoUpdated is not mutable")) + case "sourcehub.orbis.EventNodeInfoUpdated.controller_key": + panic(fmt.Errorf("field controller_key of message sourcehub.orbis.EventNodeInfoUpdated is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventNodeInfoUpdated")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventNodeInfoUpdated 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_EventNodeInfoUpdated) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.EventNodeInfoUpdated.peer_id": + return protoreflect.ValueOfString("") + case "sourcehub.orbis.EventNodeInfoUpdated.controller_key": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventNodeInfoUpdated")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventNodeInfoUpdated 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_EventNodeInfoUpdated) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.EventNodeInfoUpdated", 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_EventNodeInfoUpdated) 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_EventNodeInfoUpdated) 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_EventNodeInfoUpdated) 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_EventNodeInfoUpdated) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventNodeInfoUpdated) + 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.PeerId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ControllerKey) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventNodeInfoUpdated) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.ControllerKey) > 0 { + i -= len(x.ControllerKey) + copy(dAtA[i:], x.ControllerKey) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ControllerKey))) + i-- + dAtA[i] = 0x12 + } + if len(x.PeerId) > 0 { + i -= len(x.PeerId) + copy(dAtA[i:], x.PeerId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PeerId))) + 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().(*EventNodeInfoUpdated) + 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: EventNodeInfoUpdated: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventNodeInfoUpdated: 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 PeerId", 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.PeerId = 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 ControllerKey", 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.ControllerKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_EventRingDeleted protoreflect.MessageDescriptor + fd_EventRingDeleted_ring_id protoreflect.FieldDescriptor + fd_EventRingDeleted_reason protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_events_proto_init() + md_EventRingDeleted = File_sourcehub_orbis_events_proto.Messages().ByName("EventRingDeleted") + fd_EventRingDeleted_ring_id = md_EventRingDeleted.Fields().ByName("ring_id") + fd_EventRingDeleted_reason = md_EventRingDeleted.Fields().ByName("reason") +} + +var _ protoreflect.Message = (*fastReflection_EventRingDeleted)(nil) + +type fastReflection_EventRingDeleted EventRingDeleted + +func (x *EventRingDeleted) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventRingDeleted)(x) +} + +func (x *EventRingDeleted) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_events_proto_msgTypes[6] + 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_EventRingDeleted_messageType fastReflection_EventRingDeleted_messageType +var _ protoreflect.MessageType = fastReflection_EventRingDeleted_messageType{} + +type fastReflection_EventRingDeleted_messageType struct{} + +func (x fastReflection_EventRingDeleted_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventRingDeleted)(nil) +} +func (x fastReflection_EventRingDeleted_messageType) New() protoreflect.Message { + return new(fastReflection_EventRingDeleted) +} +func (x fastReflection_EventRingDeleted_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventRingDeleted +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventRingDeleted) Descriptor() protoreflect.MessageDescriptor { + return md_EventRingDeleted +} + +// 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_EventRingDeleted) Type() protoreflect.MessageType { + return _fastReflection_EventRingDeleted_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventRingDeleted) New() protoreflect.Message { + return new(fastReflection_EventRingDeleted) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventRingDeleted) Interface() protoreflect.ProtoMessage { + return (*EventRingDeleted)(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_EventRingDeleted) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.RingId != "" { + value := protoreflect.ValueOfString(x.RingId) + if !f(fd_EventRingDeleted_ring_id, value) { + return + } + } + if x.Reason != "" { + value := protoreflect.ValueOfString(x.Reason) + if !f(fd_EventRingDeleted_reason, 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_EventRingDeleted) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.EventRingDeleted.ring_id": + return x.RingId != "" + case "sourcehub.orbis.EventRingDeleted.reason": + return x.Reason != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventRingDeleted")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventRingDeleted 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_EventRingDeleted) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.EventRingDeleted.ring_id": + x.RingId = "" + case "sourcehub.orbis.EventRingDeleted.reason": + x.Reason = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventRingDeleted")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventRingDeleted 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_EventRingDeleted) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.EventRingDeleted.ring_id": + value := x.RingId + return protoreflect.ValueOfString(value) + case "sourcehub.orbis.EventRingDeleted.reason": + value := x.Reason + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventRingDeleted")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventRingDeleted 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_EventRingDeleted) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.EventRingDeleted.ring_id": + x.RingId = value.Interface().(string) + case "sourcehub.orbis.EventRingDeleted.reason": + x.Reason = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventRingDeleted")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventRingDeleted 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_EventRingDeleted) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.EventRingDeleted.ring_id": + panic(fmt.Errorf("field ring_id of message sourcehub.orbis.EventRingDeleted is not mutable")) + case "sourcehub.orbis.EventRingDeleted.reason": + panic(fmt.Errorf("field reason of message sourcehub.orbis.EventRingDeleted is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventRingDeleted")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventRingDeleted 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_EventRingDeleted) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.EventRingDeleted.ring_id": + return protoreflect.ValueOfString("") + case "sourcehub.orbis.EventRingDeleted.reason": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.EventRingDeleted")) + } + panic(fmt.Errorf("message sourcehub.orbis.EventRingDeleted 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_EventRingDeleted) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.EventRingDeleted", 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_EventRingDeleted) 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_EventRingDeleted) 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_EventRingDeleted) 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_EventRingDeleted) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventRingDeleted) + 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.RingId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Reason) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventRingDeleted) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Reason) > 0 { + i -= len(x.Reason) + copy(dAtA[i:], x.Reason) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Reason))) + i-- + dAtA[i] = 0x12 + } + if len(x.RingId) > 0 { + i -= len(x.RingId) + copy(dAtA[i:], x.RingId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.RingId))) + 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().(*EventRingDeleted) + 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: EventRingDeleted: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventRingDeleted: 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 RingId", 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.RingId = 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 Reason", 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.Reason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: sourcehub/orbis/events.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// EventRingCreated is emitted when a ring is created. +type EventRingCreated struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RingId string `protobuf:"bytes,1,opt,name=ring_id,json=ringId,proto3" json:"ring_id,omitempty"` + CreatorDid string `protobuf:"bytes,2,opt,name=creator_did,json=creatorDid,proto3" json:"creator_did,omitempty"` +} + +func (x *EventRingCreated) Reset() { + *x = EventRingCreated{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_events_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventRingCreated) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventRingCreated) ProtoMessage() {} + +// Deprecated: Use EventRingCreated.ProtoReflect.Descriptor instead. +func (*EventRingCreated) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_events_proto_rawDescGZIP(), []int{0} +} + +func (x *EventRingCreated) GetRingId() string { + if x != nil { + return x.RingId + } + return "" +} + +func (x *EventRingCreated) GetCreatorDid() string { + if x != nil { + return x.CreatorDid + } + return "" +} + +// EventRingUpdated is emitted when a ring is updated in place. +type EventRingUpdated struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RingId string `protobuf:"bytes,1,opt,name=ring_id,json=ringId,proto3" json:"ring_id,omitempty"` + UpdaterDid string `protobuf:"bytes,2,opt,name=updater_did,json=updaterDid,proto3" json:"updater_did,omitempty"` +} + +func (x *EventRingUpdated) Reset() { + *x = EventRingUpdated{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_events_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventRingUpdated) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventRingUpdated) ProtoMessage() {} + +// Deprecated: Use EventRingUpdated.ProtoReflect.Descriptor instead. +func (*EventRingUpdated) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_events_proto_rawDescGZIP(), []int{1} +} + +func (x *EventRingUpdated) GetRingId() string { + if x != nil { + return x.RingId + } + return "" +} + +func (x *EventRingUpdated) GetUpdaterDid() string { + if x != nil { + return x.UpdaterDid + } + return "" +} + +// EventDocumentStored is emitted when an encrypted document is stored. +type EventDocumentStored struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` + CreatorDid string `protobuf:"bytes,2,opt,name=creator_did,json=creatorDid,proto3" json:"creator_did,omitempty"` +} + +func (x *EventDocumentStored) Reset() { + *x = EventDocumentStored{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_events_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventDocumentStored) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventDocumentStored) ProtoMessage() {} + +// Deprecated: Use EventDocumentStored.ProtoReflect.Descriptor instead. +func (*EventDocumentStored) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_events_proto_rawDescGZIP(), []int{2} +} + +func (x *EventDocumentStored) GetDocumentId() string { + if x != nil { + return x.DocumentId + } + return "" +} + +func (x *EventDocumentStored) GetCreatorDid() string { + if x != nil { + return x.CreatorDid + } + return "" +} + +// EventKeyDerivationStored is emitted when a key derivation is stored. +type EventKeyDerivationStored struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + KeyDerivationId string `protobuf:"bytes,1,opt,name=key_derivation_id,json=keyDerivationId,proto3" json:"key_derivation_id,omitempty"` + CreatorDid string `protobuf:"bytes,2,opt,name=creator_did,json=creatorDid,proto3" json:"creator_did,omitempty"` +} + +func (x *EventKeyDerivationStored) Reset() { + *x = EventKeyDerivationStored{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_events_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventKeyDerivationStored) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventKeyDerivationStored) ProtoMessage() {} + +// Deprecated: Use EventKeyDerivationStored.ProtoReflect.Descriptor instead. +func (*EventKeyDerivationStored) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_events_proto_rawDescGZIP(), []int{3} +} + +func (x *EventKeyDerivationStored) GetKeyDerivationId() string { + if x != nil { + return x.KeyDerivationId + } + return "" +} + +func (x *EventKeyDerivationStored) GetCreatorDid() string { + if x != nil { + return x.CreatorDid + } + return "" +} + +// EventNodeInfoCreated is emitted when a node info record is created. +type EventNodeInfoCreated struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` + ControllerKey string `protobuf:"bytes,2,opt,name=controller_key,json=controllerKey,proto3" json:"controller_key,omitempty"` +} + +func (x *EventNodeInfoCreated) Reset() { + *x = EventNodeInfoCreated{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_events_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventNodeInfoCreated) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventNodeInfoCreated) ProtoMessage() {} + +// Deprecated: Use EventNodeInfoCreated.ProtoReflect.Descriptor instead. +func (*EventNodeInfoCreated) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_events_proto_rawDescGZIP(), []int{4} +} + +func (x *EventNodeInfoCreated) GetPeerId() string { + if x != nil { + return x.PeerId + } + return "" +} + +func (x *EventNodeInfoCreated) GetControllerKey() string { + if x != nil { + return x.ControllerKey + } + return "" +} + +// EventNodeInfoUpdated is emitted when a node info record is updated. +type EventNodeInfoUpdated struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` + ControllerKey string `protobuf:"bytes,2,opt,name=controller_key,json=controllerKey,proto3" json:"controller_key,omitempty"` +} + +func (x *EventNodeInfoUpdated) Reset() { + *x = EventNodeInfoUpdated{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_events_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventNodeInfoUpdated) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventNodeInfoUpdated) ProtoMessage() {} + +// Deprecated: Use EventNodeInfoUpdated.ProtoReflect.Descriptor instead. +func (*EventNodeInfoUpdated) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_events_proto_rawDescGZIP(), []int{5} +} + +func (x *EventNodeInfoUpdated) GetPeerId() string { + if x != nil { + return x.PeerId + } + return "" +} + +func (x *EventNodeInfoUpdated) GetControllerKey() string { + if x != nil { + return x.ControllerKey + } + return "" +} + +// EventRingDeleted is emitted when a ring is removed from state. +type EventRingDeleted struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RingId string `protobuf:"bytes,1,opt,name=ring_id,json=ringId,proto3" json:"ring_id,omitempty"` + Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` +} + +func (x *EventRingDeleted) Reset() { + *x = EventRingDeleted{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_events_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventRingDeleted) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventRingDeleted) ProtoMessage() {} + +// Deprecated: Use EventRingDeleted.ProtoReflect.Descriptor instead. +func (*EventRingDeleted) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_events_proto_rawDescGZIP(), []int{6} +} + +func (x *EventRingDeleted) GetRingId() string { + if x != nil { + return x.RingId + } + return "" +} + +func (x *EventRingDeleted) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +var File_sourcehub_orbis_events_proto protoreflect.FileDescriptor + +var file_sourcehub_orbis_events_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x6f, 0x72, 0x62, 0x69, + 0x73, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x22, + 0x4c, 0x0a, 0x10, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x69, 0x6e, 0x67, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x69, 0x64, 0x22, 0x4c, 0x0a, + 0x10, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x69, 0x6e, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x72, 0x5f, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x72, 0x44, 0x69, 0x64, 0x22, 0x57, 0x0a, 0x13, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x64, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, + 0x72, 0x44, 0x69, 0x64, 0x22, 0x67, 0x0a, 0x18, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, + 0x44, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x64, + 0x12, 0x2a, 0x0a, 0x11, 0x6b, 0x65, 0x79, 0x5f, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6b, 0x65, 0x79, + 0x44, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x69, 0x64, 0x22, 0x56, 0x0a, + 0x14, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, + 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x6b, 0x65, 0x79, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x65, 0x72, 0x4b, 0x65, 0x79, 0x22, 0x56, 0x0a, 0x14, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4e, 0x6f, + 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x17, 0x0a, + 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x4b, 0x65, 0x79, 0x22, 0x43, 0x0a, + 0x10, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x64, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x72, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, + 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, + 0x6f, 0x6e, 0x42, 0xa1, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x42, 0x0b, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x6f, 0x72, 0x62, 0x69, 0x73, 0xa2, 0x02, 0x03, 0x53, 0x4f, + 0x58, 0xaa, 0x02, 0x0f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x4f, 0x72, + 0x62, 0x69, 0x73, 0xca, 0x02, 0x0f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x5c, + 0x4f, 0x72, 0x62, 0x69, 0x73, 0xe2, 0x02, 0x1b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, + 0x62, 0x5c, 0x4f, 0x72, 0x62, 0x69, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x3a, + 0x3a, 0x4f, 0x72, 0x62, 0x69, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_sourcehub_orbis_events_proto_rawDescOnce sync.Once + file_sourcehub_orbis_events_proto_rawDescData = file_sourcehub_orbis_events_proto_rawDesc +) + +func file_sourcehub_orbis_events_proto_rawDescGZIP() []byte { + file_sourcehub_orbis_events_proto_rawDescOnce.Do(func() { + file_sourcehub_orbis_events_proto_rawDescData = protoimpl.X.CompressGZIP(file_sourcehub_orbis_events_proto_rawDescData) + }) + return file_sourcehub_orbis_events_proto_rawDescData +} + +var file_sourcehub_orbis_events_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_sourcehub_orbis_events_proto_goTypes = []interface{}{ + (*EventRingCreated)(nil), // 0: sourcehub.orbis.EventRingCreated + (*EventRingUpdated)(nil), // 1: sourcehub.orbis.EventRingUpdated + (*EventDocumentStored)(nil), // 2: sourcehub.orbis.EventDocumentStored + (*EventKeyDerivationStored)(nil), // 3: sourcehub.orbis.EventKeyDerivationStored + (*EventNodeInfoCreated)(nil), // 4: sourcehub.orbis.EventNodeInfoCreated + (*EventNodeInfoUpdated)(nil), // 5: sourcehub.orbis.EventNodeInfoUpdated + (*EventRingDeleted)(nil), // 6: sourcehub.orbis.EventRingDeleted +} +var file_sourcehub_orbis_events_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_sourcehub_orbis_events_proto_init() } +func file_sourcehub_orbis_events_proto_init() { + if File_sourcehub_orbis_events_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_sourcehub_orbis_events_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventRingCreated); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sourcehub_orbis_events_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventRingUpdated); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sourcehub_orbis_events_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventDocumentStored); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sourcehub_orbis_events_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventKeyDerivationStored); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sourcehub_orbis_events_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventNodeInfoCreated); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sourcehub_orbis_events_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventNodeInfoUpdated); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sourcehub_orbis_events_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventRingDeleted); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_sourcehub_orbis_events_proto_rawDesc, + NumEnums: 0, + NumMessages: 7, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_sourcehub_orbis_events_proto_goTypes, + DependencyIndexes: file_sourcehub_orbis_events_proto_depIdxs, + MessageInfos: file_sourcehub_orbis_events_proto_msgTypes, + }.Build() + File_sourcehub_orbis_events_proto = out.File + file_sourcehub_orbis_events_proto_rawDesc = nil + file_sourcehub_orbis_events_proto_goTypes = nil + file_sourcehub_orbis_events_proto_depIdxs = nil +} diff --git a/api/sourcehub/orbis/genesis.pulsar.go b/api/sourcehub/orbis/genesis.pulsar.go new file mode 100644 index 00000000..02e0e378 --- /dev/null +++ b/api/sourcehub/orbis/genesis.pulsar.go @@ -0,0 +1,1215 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package orbis + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var _ protoreflect.List = (*_GenesisState_2_list)(nil) + +type _GenesisState_2_list struct { + list *[]*Ring +} + +func (x *_GenesisState_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Ring) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Ring) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_2_list) AppendMutable() protoreflect.Value { + v := new(Ring) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_2_list) NewElement() protoreflect.Value { + v := new(Ring) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_2_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_GenesisState_3_list)(nil) + +type _GenesisState_3_list struct { + list *[]*Document +} + +func (x *_GenesisState_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Document) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Document) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_3_list) AppendMutable() protoreflect.Value { + v := new(Document) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_3_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_3_list) NewElement() protoreflect.Value { + v := new(Document) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_3_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_GenesisState_4_list)(nil) + +type _GenesisState_4_list struct { + list *[]*KeyDerivation +} + +func (x *_GenesisState_4_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_4_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_4_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*KeyDerivation) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_4_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*KeyDerivation) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_4_list) AppendMutable() protoreflect.Value { + v := new(KeyDerivation) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_4_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_4_list) NewElement() protoreflect.Value { + v := new(KeyDerivation) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_4_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_GenesisState_5_list)(nil) + +type _GenesisState_5_list struct { + list *[]*NodeInfoEntry +} + +func (x *_GenesisState_5_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_5_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_5_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*NodeInfoEntry) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_5_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*NodeInfoEntry) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_5_list) AppendMutable() protoreflect.Value { + v := new(NodeInfoEntry) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_5_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_5_list) NewElement() protoreflect.Value { + v := new(NodeInfoEntry) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_5_list) IsValid() bool { + return x.list != nil +} + +var ( + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_params protoreflect.FieldDescriptor + fd_GenesisState_rings protoreflect.FieldDescriptor + fd_GenesisState_documents protoreflect.FieldDescriptor + fd_GenesisState_key_derivations protoreflect.FieldDescriptor + fd_GenesisState_node_infos protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_genesis_proto_init() + md_GenesisState = File_sourcehub_orbis_genesis_proto.Messages().ByName("GenesisState") + fd_GenesisState_params = md_GenesisState.Fields().ByName("params") + fd_GenesisState_rings = md_GenesisState.Fields().ByName("rings") + fd_GenesisState_documents = md_GenesisState.Fields().ByName("documents") + fd_GenesisState_key_derivations = md_GenesisState.Fields().ByName("key_derivations") + fd_GenesisState_node_infos = md_GenesisState.Fields().ByName("node_infos") +} + +var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) + +type fastReflection_GenesisState GenesisState + +func (x *GenesisState) ProtoReflect() protoreflect.Message { + return (*fastReflection_GenesisState)(x) +} + +func (x *GenesisState) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_genesis_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_GenesisState_messageType fastReflection_GenesisState_messageType +var _ protoreflect.MessageType = fastReflection_GenesisState_messageType{} + +type fastReflection_GenesisState_messageType struct{} + +func (x fastReflection_GenesisState_messageType) Zero() protoreflect.Message { + return (*fastReflection_GenesisState)(nil) +} +func (x fastReflection_GenesisState_messageType) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} +func (x fastReflection_GenesisState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GenesisState) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_GenesisState) Type() protoreflect.MessageType { + return _fastReflection_GenesisState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GenesisState) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { + return (*GenesisState)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_GenesisState_params, value) { + return + } + } + if len(x.Rings) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_2_list{list: &x.Rings}) + if !f(fd_GenesisState_rings, value) { + return + } + } + if len(x.Documents) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_3_list{list: &x.Documents}) + if !f(fd_GenesisState_documents, value) { + return + } + } + if len(x.KeyDerivations) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_4_list{list: &x.KeyDerivations}) + if !f(fd_GenesisState_key_derivations, value) { + return + } + } + if len(x.NodeInfos) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_5_list{list: &x.NodeInfos}) + if !f(fd_GenesisState_node_infos, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.GenesisState.params": + return x.Params != nil + case "sourcehub.orbis.GenesisState.rings": + return len(x.Rings) != 0 + case "sourcehub.orbis.GenesisState.documents": + return len(x.Documents) != 0 + case "sourcehub.orbis.GenesisState.key_derivations": + return len(x.KeyDerivations) != 0 + case "sourcehub.orbis.GenesisState.node_infos": + return len(x.NodeInfos) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.GenesisState")) + } + panic(fmt.Errorf("message sourcehub.orbis.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.GenesisState.params": + x.Params = nil + case "sourcehub.orbis.GenesisState.rings": + x.Rings = nil + case "sourcehub.orbis.GenesisState.documents": + x.Documents = nil + case "sourcehub.orbis.GenesisState.key_derivations": + x.KeyDerivations = nil + case "sourcehub.orbis.GenesisState.node_infos": + x.NodeInfos = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.GenesisState")) + } + panic(fmt.Errorf("message sourcehub.orbis.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.GenesisState.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "sourcehub.orbis.GenesisState.rings": + if len(x.Rings) == 0 { + return protoreflect.ValueOfList(&_GenesisState_2_list{}) + } + listValue := &_GenesisState_2_list{list: &x.Rings} + return protoreflect.ValueOfList(listValue) + case "sourcehub.orbis.GenesisState.documents": + if len(x.Documents) == 0 { + return protoreflect.ValueOfList(&_GenesisState_3_list{}) + } + listValue := &_GenesisState_3_list{list: &x.Documents} + return protoreflect.ValueOfList(listValue) + case "sourcehub.orbis.GenesisState.key_derivations": + if len(x.KeyDerivations) == 0 { + return protoreflect.ValueOfList(&_GenesisState_4_list{}) + } + listValue := &_GenesisState_4_list{list: &x.KeyDerivations} + return protoreflect.ValueOfList(listValue) + case "sourcehub.orbis.GenesisState.node_infos": + if len(x.NodeInfos) == 0 { + return protoreflect.ValueOfList(&_GenesisState_5_list{}) + } + listValue := &_GenesisState_5_list{list: &x.NodeInfos} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.GenesisState")) + } + panic(fmt.Errorf("message sourcehub.orbis.GenesisState does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.GenesisState.params": + x.Params = value.Message().Interface().(*Params) + case "sourcehub.orbis.GenesisState.rings": + lv := value.List() + clv := lv.(*_GenesisState_2_list) + x.Rings = *clv.list + case "sourcehub.orbis.GenesisState.documents": + lv := value.List() + clv := lv.(*_GenesisState_3_list) + x.Documents = *clv.list + case "sourcehub.orbis.GenesisState.key_derivations": + lv := value.List() + clv := lv.(*_GenesisState_4_list) + x.KeyDerivations = *clv.list + case "sourcehub.orbis.GenesisState.node_infos": + lv := value.List() + clv := lv.(*_GenesisState_5_list) + x.NodeInfos = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.GenesisState")) + } + panic(fmt.Errorf("message sourcehub.orbis.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.GenesisState.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + case "sourcehub.orbis.GenesisState.rings": + if x.Rings == nil { + x.Rings = []*Ring{} + } + value := &_GenesisState_2_list{list: &x.Rings} + return protoreflect.ValueOfList(value) + case "sourcehub.orbis.GenesisState.documents": + if x.Documents == nil { + x.Documents = []*Document{} + } + value := &_GenesisState_3_list{list: &x.Documents} + return protoreflect.ValueOfList(value) + case "sourcehub.orbis.GenesisState.key_derivations": + if x.KeyDerivations == nil { + x.KeyDerivations = []*KeyDerivation{} + } + value := &_GenesisState_4_list{list: &x.KeyDerivations} + return protoreflect.ValueOfList(value) + case "sourcehub.orbis.GenesisState.node_infos": + if x.NodeInfos == nil { + x.NodeInfos = []*NodeInfoEntry{} + } + value := &_GenesisState_5_list{list: &x.NodeInfos} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.GenesisState")) + } + panic(fmt.Errorf("message sourcehub.orbis.GenesisState does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.GenesisState.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "sourcehub.orbis.GenesisState.rings": + list := []*Ring{} + return protoreflect.ValueOfList(&_GenesisState_2_list{list: &list}) + case "sourcehub.orbis.GenesisState.documents": + list := []*Document{} + return protoreflect.ValueOfList(&_GenesisState_3_list{list: &list}) + case "sourcehub.orbis.GenesisState.key_derivations": + list := []*KeyDerivation{} + return protoreflect.ValueOfList(&_GenesisState_4_list{list: &list}) + case "sourcehub.orbis.GenesisState.node_infos": + list := []*NodeInfoEntry{} + return protoreflect.ValueOfList(&_GenesisState_5_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.GenesisState")) + } + panic(fmt.Errorf("message sourcehub.orbis.GenesisState does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_GenesisState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.GenesisState", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_GenesisState) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_GenesisState) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Rings) > 0 { + for _, e := range x.Rings { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.Documents) > 0 { + for _, e := range x.Documents { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.KeyDerivations) > 0 { + for _, e := range x.KeyDerivations { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.NodeInfos) > 0 { + for _, e := range x.NodeInfos { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.NodeInfos) > 0 { + for iNdEx := len(x.NodeInfos) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.NodeInfos[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] = 0x2a + } + } + if len(x.KeyDerivations) > 0 { + for iNdEx := len(x.KeyDerivations) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.KeyDerivations[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] = 0x22 + } + } + if len(x.Documents) > 0 { + for iNdEx := len(x.Documents) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Documents[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] = 0x1a + } + } + if len(x.Rings) > 0 { + for iNdEx := len(x.Rings) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Rings[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] = 0x12 + } + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Rings", 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.Rings = append(x.Rings, &Ring{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Rings[len(x.Rings)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Documents", 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.Documents = append(x.Documents, &Document{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Documents[len(x.Documents)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field KeyDerivations", 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.KeyDerivations = append(x.KeyDerivations, &KeyDerivation{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.KeyDerivations[len(x.KeyDerivations)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NodeInfos", 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.NodeInfos = append(x.NodeInfos, &NodeInfoEntry{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.NodeInfos[len(x.NodeInfos)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: sourcehub/orbis/genesis.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// GenesisState defines the orbis module's genesis state. +type GenesisState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` + Rings []*Ring `protobuf:"bytes,2,rep,name=rings,proto3" json:"rings,omitempty"` + Documents []*Document `protobuf:"bytes,3,rep,name=documents,proto3" json:"documents,omitempty"` + KeyDerivations []*KeyDerivation `protobuf:"bytes,4,rep,name=key_derivations,json=keyDerivations,proto3" json:"key_derivations,omitempty"` + NodeInfos []*NodeInfoEntry `protobuf:"bytes,5,rep,name=node_infos,json=nodeInfos,proto3" json:"node_infos,omitempty"` +} + +func (x *GenesisState) Reset() { + *x = GenesisState{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_genesis_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenesisState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenesisState) ProtoMessage() {} + +// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead. +func (*GenesisState) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_genesis_proto_rawDescGZIP(), []int{0} +} + +func (x *GenesisState) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +func (x *GenesisState) GetRings() []*Ring { + if x != nil { + return x.Rings + } + return nil +} + +func (x *GenesisState) GetDocuments() []*Document { + if x != nil { + return x.Documents + } + return nil +} + +func (x *GenesisState) GetKeyDerivations() []*KeyDerivation { + if x != nil { + return x.KeyDerivations + } + return nil +} + +func (x *GenesisState) GetNodeInfos() []*NodeInfoEntry { + if x != nil { + return x.NodeInfos + } + return nil +} + +var File_sourcehub_orbis_genesis_proto protoreflect.FileDescriptor + +var file_sourcehub_orbis_genesis_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x6f, 0x72, 0x62, 0x69, + 0x73, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, + 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, + 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x68, 0x75, 0x62, 0x2f, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, + 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x24, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x68, 0x75, 0x62, 0x2f, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2f, 0x6b, 0x65, 0x79, 0x5f, 0x64, + 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x6f, 0x72, 0x62, 0x69, 0x73, + 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x6f, 0x72, 0x62, 0x69, + 0x73, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2f, + 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe4, 0x02, 0x0a, 0x0c, 0x47, + 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3a, 0x0a, 0x06, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2e, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, + 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x05, 0x72, 0x69, 0x6e, 0x67, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, + 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2e, 0x52, 0x69, 0x6e, 0x67, 0x42, 0x09, 0xc8, + 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x05, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x12, + 0x42, 0x0a, 0x09, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, + 0x72, 0x62, 0x69, 0x73, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x09, 0xc8, + 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x09, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x12, 0x52, 0x0a, 0x0f, 0x6b, 0x65, 0x79, 0x5f, 0x64, 0x65, 0x72, 0x69, 0x76, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2e, 0x4b, + 0x65, 0x79, 0x44, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, + 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x6b, 0x65, 0x79, 0x44, 0x65, 0x72, 0x69, + 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x48, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x5f, + 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2e, 0x4e, 0x6f, + 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x09, 0xc8, 0xde, 0x1f, + 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, + 0x73, 0x42, 0xa2, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, + 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x6f, 0x72, 0x62, 0x69, 0x73, 0xa2, 0x02, 0x03, 0x53, 0x4f, + 0x58, 0xaa, 0x02, 0x0f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x4f, 0x72, + 0x62, 0x69, 0x73, 0xca, 0x02, 0x0f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x5c, + 0x4f, 0x72, 0x62, 0x69, 0x73, 0xe2, 0x02, 0x1b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, + 0x62, 0x5c, 0x4f, 0x72, 0x62, 0x69, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x3a, + 0x3a, 0x4f, 0x72, 0x62, 0x69, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_sourcehub_orbis_genesis_proto_rawDescOnce sync.Once + file_sourcehub_orbis_genesis_proto_rawDescData = file_sourcehub_orbis_genesis_proto_rawDesc +) + +func file_sourcehub_orbis_genesis_proto_rawDescGZIP() []byte { + file_sourcehub_orbis_genesis_proto_rawDescOnce.Do(func() { + file_sourcehub_orbis_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_sourcehub_orbis_genesis_proto_rawDescData) + }) + return file_sourcehub_orbis_genesis_proto_rawDescData +} + +var file_sourcehub_orbis_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_sourcehub_orbis_genesis_proto_goTypes = []interface{}{ + (*GenesisState)(nil), // 0: sourcehub.orbis.GenesisState + (*Params)(nil), // 1: sourcehub.orbis.Params + (*Ring)(nil), // 2: sourcehub.orbis.Ring + (*Document)(nil), // 3: sourcehub.orbis.Document + (*KeyDerivation)(nil), // 4: sourcehub.orbis.KeyDerivation + (*NodeInfoEntry)(nil), // 5: sourcehub.orbis.NodeInfoEntry +} +var file_sourcehub_orbis_genesis_proto_depIdxs = []int32{ + 1, // 0: sourcehub.orbis.GenesisState.params:type_name -> sourcehub.orbis.Params + 2, // 1: sourcehub.orbis.GenesisState.rings:type_name -> sourcehub.orbis.Ring + 3, // 2: sourcehub.orbis.GenesisState.documents:type_name -> sourcehub.orbis.Document + 4, // 3: sourcehub.orbis.GenesisState.key_derivations:type_name -> sourcehub.orbis.KeyDerivation + 5, // 4: sourcehub.orbis.GenesisState.node_infos:type_name -> sourcehub.orbis.NodeInfoEntry + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_sourcehub_orbis_genesis_proto_init() } +func file_sourcehub_orbis_genesis_proto_init() { + if File_sourcehub_orbis_genesis_proto != nil { + return + } + file_sourcehub_orbis_document_proto_init() + file_sourcehub_orbis_key_derivation_proto_init() + file_sourcehub_orbis_node_info_proto_init() + file_sourcehub_orbis_params_proto_init() + file_sourcehub_orbis_ring_proto_init() + if !protoimpl.UnsafeEnabled { + file_sourcehub_orbis_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenesisState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_sourcehub_orbis_genesis_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_sourcehub_orbis_genesis_proto_goTypes, + DependencyIndexes: file_sourcehub_orbis_genesis_proto_depIdxs, + MessageInfos: file_sourcehub_orbis_genesis_proto_msgTypes, + }.Build() + File_sourcehub_orbis_genesis_proto = out.File + file_sourcehub_orbis_genesis_proto_rawDesc = nil + file_sourcehub_orbis_genesis_proto_goTypes = nil + file_sourcehub_orbis_genesis_proto_depIdxs = nil +} diff --git a/api/sourcehub/orbis/key_derivation.pulsar.go b/api/sourcehub/orbis/key_derivation.pulsar.go new file mode 100644 index 00000000..3b1176d4 --- /dev/null +++ b/api/sourcehub/orbis/key_derivation.pulsar.go @@ -0,0 +1,1010 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package orbis + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_KeyDerivation protoreflect.MessageDescriptor + fd_KeyDerivation_id protoreflect.FieldDescriptor + fd_KeyDerivation_creator_did protoreflect.FieldDescriptor + fd_KeyDerivation_ring_id protoreflect.FieldDescriptor + fd_KeyDerivation_derivation protoreflect.FieldDescriptor + fd_KeyDerivation_policy_id protoreflect.FieldDescriptor + fd_KeyDerivation_resource protoreflect.FieldDescriptor + fd_KeyDerivation_permission protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_key_derivation_proto_init() + md_KeyDerivation = File_sourcehub_orbis_key_derivation_proto.Messages().ByName("KeyDerivation") + fd_KeyDerivation_id = md_KeyDerivation.Fields().ByName("id") + fd_KeyDerivation_creator_did = md_KeyDerivation.Fields().ByName("creator_did") + fd_KeyDerivation_ring_id = md_KeyDerivation.Fields().ByName("ring_id") + fd_KeyDerivation_derivation = md_KeyDerivation.Fields().ByName("derivation") + fd_KeyDerivation_policy_id = md_KeyDerivation.Fields().ByName("policy_id") + fd_KeyDerivation_resource = md_KeyDerivation.Fields().ByName("resource") + fd_KeyDerivation_permission = md_KeyDerivation.Fields().ByName("permission") +} + +var _ protoreflect.Message = (*fastReflection_KeyDerivation)(nil) + +type fastReflection_KeyDerivation KeyDerivation + +func (x *KeyDerivation) ProtoReflect() protoreflect.Message { + return (*fastReflection_KeyDerivation)(x) +} + +func (x *KeyDerivation) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_key_derivation_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_KeyDerivation_messageType fastReflection_KeyDerivation_messageType +var _ protoreflect.MessageType = fastReflection_KeyDerivation_messageType{} + +type fastReflection_KeyDerivation_messageType struct{} + +func (x fastReflection_KeyDerivation_messageType) Zero() protoreflect.Message { + return (*fastReflection_KeyDerivation)(nil) +} +func (x fastReflection_KeyDerivation_messageType) New() protoreflect.Message { + return new(fastReflection_KeyDerivation) +} +func (x fastReflection_KeyDerivation_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_KeyDerivation +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_KeyDerivation) Descriptor() protoreflect.MessageDescriptor { + return md_KeyDerivation +} + +// 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_KeyDerivation) Type() protoreflect.MessageType { + return _fastReflection_KeyDerivation_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_KeyDerivation) New() protoreflect.Message { + return new(fastReflection_KeyDerivation) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_KeyDerivation) Interface() protoreflect.ProtoMessage { + return (*KeyDerivation)(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_KeyDerivation) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_KeyDerivation_id, value) { + return + } + } + if x.CreatorDid != "" { + value := protoreflect.ValueOfString(x.CreatorDid) + if !f(fd_KeyDerivation_creator_did, value) { + return + } + } + if x.RingId != "" { + value := protoreflect.ValueOfString(x.RingId) + if !f(fd_KeyDerivation_ring_id, value) { + return + } + } + if x.Derivation != "" { + value := protoreflect.ValueOfString(x.Derivation) + if !f(fd_KeyDerivation_derivation, value) { + return + } + } + if x.PolicyId != "" { + value := protoreflect.ValueOfString(x.PolicyId) + if !f(fd_KeyDerivation_policy_id, value) { + return + } + } + if x.Resource != "" { + value := protoreflect.ValueOfString(x.Resource) + if !f(fd_KeyDerivation_resource, value) { + return + } + } + if x.Permission != "" { + value := protoreflect.ValueOfString(x.Permission) + if !f(fd_KeyDerivation_permission, 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_KeyDerivation) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.KeyDerivation.id": + return x.Id != "" + case "sourcehub.orbis.KeyDerivation.creator_did": + return x.CreatorDid != "" + case "sourcehub.orbis.KeyDerivation.ring_id": + return x.RingId != "" + case "sourcehub.orbis.KeyDerivation.derivation": + return x.Derivation != "" + case "sourcehub.orbis.KeyDerivation.policy_id": + return x.PolicyId != "" + case "sourcehub.orbis.KeyDerivation.resource": + return x.Resource != "" + case "sourcehub.orbis.KeyDerivation.permission": + return x.Permission != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.KeyDerivation")) + } + panic(fmt.Errorf("message sourcehub.orbis.KeyDerivation 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_KeyDerivation) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.KeyDerivation.id": + x.Id = "" + case "sourcehub.orbis.KeyDerivation.creator_did": + x.CreatorDid = "" + case "sourcehub.orbis.KeyDerivation.ring_id": + x.RingId = "" + case "sourcehub.orbis.KeyDerivation.derivation": + x.Derivation = "" + case "sourcehub.orbis.KeyDerivation.policy_id": + x.PolicyId = "" + case "sourcehub.orbis.KeyDerivation.resource": + x.Resource = "" + case "sourcehub.orbis.KeyDerivation.permission": + x.Permission = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.KeyDerivation")) + } + panic(fmt.Errorf("message sourcehub.orbis.KeyDerivation 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_KeyDerivation) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.KeyDerivation.id": + value := x.Id + return protoreflect.ValueOfString(value) + case "sourcehub.orbis.KeyDerivation.creator_did": + value := x.CreatorDid + return protoreflect.ValueOfString(value) + case "sourcehub.orbis.KeyDerivation.ring_id": + value := x.RingId + return protoreflect.ValueOfString(value) + case "sourcehub.orbis.KeyDerivation.derivation": + value := x.Derivation + return protoreflect.ValueOfString(value) + case "sourcehub.orbis.KeyDerivation.policy_id": + value := x.PolicyId + return protoreflect.ValueOfString(value) + case "sourcehub.orbis.KeyDerivation.resource": + value := x.Resource + return protoreflect.ValueOfString(value) + case "sourcehub.orbis.KeyDerivation.permission": + value := x.Permission + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.KeyDerivation")) + } + panic(fmt.Errorf("message sourcehub.orbis.KeyDerivation 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_KeyDerivation) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.KeyDerivation.id": + x.Id = value.Interface().(string) + case "sourcehub.orbis.KeyDerivation.creator_did": + x.CreatorDid = value.Interface().(string) + case "sourcehub.orbis.KeyDerivation.ring_id": + x.RingId = value.Interface().(string) + case "sourcehub.orbis.KeyDerivation.derivation": + x.Derivation = value.Interface().(string) + case "sourcehub.orbis.KeyDerivation.policy_id": + x.PolicyId = value.Interface().(string) + case "sourcehub.orbis.KeyDerivation.resource": + x.Resource = value.Interface().(string) + case "sourcehub.orbis.KeyDerivation.permission": + x.Permission = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.KeyDerivation")) + } + panic(fmt.Errorf("message sourcehub.orbis.KeyDerivation 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_KeyDerivation) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.KeyDerivation.id": + panic(fmt.Errorf("field id of message sourcehub.orbis.KeyDerivation is not mutable")) + case "sourcehub.orbis.KeyDerivation.creator_did": + panic(fmt.Errorf("field creator_did of message sourcehub.orbis.KeyDerivation is not mutable")) + case "sourcehub.orbis.KeyDerivation.ring_id": + panic(fmt.Errorf("field ring_id of message sourcehub.orbis.KeyDerivation is not mutable")) + case "sourcehub.orbis.KeyDerivation.derivation": + panic(fmt.Errorf("field derivation of message sourcehub.orbis.KeyDerivation is not mutable")) + case "sourcehub.orbis.KeyDerivation.policy_id": + panic(fmt.Errorf("field policy_id of message sourcehub.orbis.KeyDerivation is not mutable")) + case "sourcehub.orbis.KeyDerivation.resource": + panic(fmt.Errorf("field resource of message sourcehub.orbis.KeyDerivation is not mutable")) + case "sourcehub.orbis.KeyDerivation.permission": + panic(fmt.Errorf("field permission of message sourcehub.orbis.KeyDerivation is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.KeyDerivation")) + } + panic(fmt.Errorf("message sourcehub.orbis.KeyDerivation 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_KeyDerivation) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.KeyDerivation.id": + return protoreflect.ValueOfString("") + case "sourcehub.orbis.KeyDerivation.creator_did": + return protoreflect.ValueOfString("") + case "sourcehub.orbis.KeyDerivation.ring_id": + return protoreflect.ValueOfString("") + case "sourcehub.orbis.KeyDerivation.derivation": + return protoreflect.ValueOfString("") + case "sourcehub.orbis.KeyDerivation.policy_id": + return protoreflect.ValueOfString("") + case "sourcehub.orbis.KeyDerivation.resource": + return protoreflect.ValueOfString("") + case "sourcehub.orbis.KeyDerivation.permission": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.KeyDerivation")) + } + panic(fmt.Errorf("message sourcehub.orbis.KeyDerivation 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_KeyDerivation) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.KeyDerivation", 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_KeyDerivation) 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_KeyDerivation) 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_KeyDerivation) 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_KeyDerivation) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*KeyDerivation) + 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.Id) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.CreatorDid) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.RingId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Derivation) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.PolicyId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Resource) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Permission) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*KeyDerivation) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Permission) > 0 { + i -= len(x.Permission) + copy(dAtA[i:], x.Permission) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Permission))) + i-- + dAtA[i] = 0x3a + } + if len(x.Resource) > 0 { + i -= len(x.Resource) + copy(dAtA[i:], x.Resource) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Resource))) + i-- + dAtA[i] = 0x32 + } + if len(x.PolicyId) > 0 { + i -= len(x.PolicyId) + copy(dAtA[i:], x.PolicyId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PolicyId))) + i-- + dAtA[i] = 0x2a + } + if len(x.Derivation) > 0 { + i -= len(x.Derivation) + copy(dAtA[i:], x.Derivation) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Derivation))) + i-- + dAtA[i] = 0x22 + } + if len(x.RingId) > 0 { + i -= len(x.RingId) + copy(dAtA[i:], x.RingId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.RingId))) + i-- + dAtA[i] = 0x1a + } + if len(x.CreatorDid) > 0 { + i -= len(x.CreatorDid) + copy(dAtA[i:], x.CreatorDid) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.CreatorDid))) + i-- + dAtA[i] = 0x12 + } + if len(x.Id) > 0 { + i -= len(x.Id) + copy(dAtA[i:], x.Id) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + 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().(*KeyDerivation) + 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: KeyDerivation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: KeyDerivation: 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 Id", 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.Id = 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 CreatorDid", 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.CreatorDid = 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 RingId", 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.RingId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Derivation", 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.Derivation = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PolicyId", 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.PolicyId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Resource", 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.Resource = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Permission", 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.Permission = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: sourcehub/orbis/key_derivation.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// KeyDerivation stores a signing derivation and its policy binding metadata. +type KeyDerivation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + CreatorDid string `protobuf:"bytes,2,opt,name=creator_did,json=creatorDid,proto3" json:"creator_did,omitempty"` + RingId string `protobuf:"bytes,3,opt,name=ring_id,json=ringId,proto3" json:"ring_id,omitempty"` + Derivation string `protobuf:"bytes,4,opt,name=derivation,proto3" json:"derivation,omitempty"` + PolicyId string `protobuf:"bytes,5,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"` + Resource string `protobuf:"bytes,6,opt,name=resource,proto3" json:"resource,omitempty"` + Permission string `protobuf:"bytes,7,opt,name=permission,proto3" json:"permission,omitempty"` +} + +func (x *KeyDerivation) Reset() { + *x = KeyDerivation{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_key_derivation_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeyDerivation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeyDerivation) ProtoMessage() {} + +// Deprecated: Use KeyDerivation.ProtoReflect.Descriptor instead. +func (*KeyDerivation) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_key_derivation_proto_rawDescGZIP(), []int{0} +} + +func (x *KeyDerivation) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *KeyDerivation) GetCreatorDid() string { + if x != nil { + return x.CreatorDid + } + return "" +} + +func (x *KeyDerivation) GetRingId() string { + if x != nil { + return x.RingId + } + return "" +} + +func (x *KeyDerivation) GetDerivation() string { + if x != nil { + return x.Derivation + } + return "" +} + +func (x *KeyDerivation) GetPolicyId() string { + if x != nil { + return x.PolicyId + } + return "" +} + +func (x *KeyDerivation) GetResource() string { + if x != nil { + return x.Resource + } + return "" +} + +func (x *KeyDerivation) GetPermission() string { + if x != nil { + return x.Permission + } + return "" +} + +var File_sourcehub_orbis_key_derivation_proto protoreflect.FileDescriptor + +var file_sourcehub_orbis_key_derivation_proto_rawDesc = []byte{ + 0x0a, 0x24, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x6f, 0x72, 0x62, 0x69, + 0x73, 0x2f, 0x6b, 0x65, 0x79, 0x5f, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, + 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x22, 0xd2, 0x01, 0x0a, 0x0d, 0x4b, 0x65, 0x79, 0x44, + 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x69, + 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x69, 0x6e, + 0x67, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x69, 0x64, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x49, 0x64, + 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1e, 0x0a, 0x0a, + 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0xa8, 0x01, 0x0a, + 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, + 0x72, 0x62, 0x69, 0x73, 0x42, 0x12, 0x4b, 0x65, 0x79, 0x44, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x6f, 0x72, 0x62, 0x69, 0x73, 0xa2, 0x02, 0x03, 0x53, + 0x4f, 0x58, 0xaa, 0x02, 0x0f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x4f, + 0x72, 0x62, 0x69, 0x73, 0xca, 0x02, 0x0f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, + 0x5c, 0x4f, 0x72, 0x62, 0x69, 0x73, 0xe2, 0x02, 0x1b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, + 0x75, 0x62, 0x5c, 0x4f, 0x72, 0x62, 0x69, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, + 0x3a, 0x3a, 0x4f, 0x72, 0x62, 0x69, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_sourcehub_orbis_key_derivation_proto_rawDescOnce sync.Once + file_sourcehub_orbis_key_derivation_proto_rawDescData = file_sourcehub_orbis_key_derivation_proto_rawDesc +) + +func file_sourcehub_orbis_key_derivation_proto_rawDescGZIP() []byte { + file_sourcehub_orbis_key_derivation_proto_rawDescOnce.Do(func() { + file_sourcehub_orbis_key_derivation_proto_rawDescData = protoimpl.X.CompressGZIP(file_sourcehub_orbis_key_derivation_proto_rawDescData) + }) + return file_sourcehub_orbis_key_derivation_proto_rawDescData +} + +var file_sourcehub_orbis_key_derivation_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_sourcehub_orbis_key_derivation_proto_goTypes = []interface{}{ + (*KeyDerivation)(nil), // 0: sourcehub.orbis.KeyDerivation +} +var file_sourcehub_orbis_key_derivation_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_sourcehub_orbis_key_derivation_proto_init() } +func file_sourcehub_orbis_key_derivation_proto_init() { + if File_sourcehub_orbis_key_derivation_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_sourcehub_orbis_key_derivation_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeyDerivation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_sourcehub_orbis_key_derivation_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_sourcehub_orbis_key_derivation_proto_goTypes, + DependencyIndexes: file_sourcehub_orbis_key_derivation_proto_depIdxs, + MessageInfos: file_sourcehub_orbis_key_derivation_proto_msgTypes, + }.Build() + File_sourcehub_orbis_key_derivation_proto = out.File + file_sourcehub_orbis_key_derivation_proto_rawDesc = nil + file_sourcehub_orbis_key_derivation_proto_goTypes = nil + file_sourcehub_orbis_key_derivation_proto_depIdxs = nil +} diff --git a/api/sourcehub/orbis/module/module.pulsar.go b/api/sourcehub/orbis/module/module.pulsar.go new file mode 100644 index 00000000..bafd896e --- /dev/null +++ b/api/sourcehub/orbis/module/module.pulsar.go @@ -0,0 +1,578 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package module + +import ( + _ "cosmossdk.io/api/cosmos/app/v1alpha1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Module protoreflect.MessageDescriptor + fd_Module_authority protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_module_module_proto_init() + md_Module = File_sourcehub_orbis_module_module_proto.Messages().ByName("Module") + fd_Module_authority = md_Module.Fields().ByName("authority") +} + +var _ protoreflect.Message = (*fastReflection_Module)(nil) + +type fastReflection_Module Module + +func (x *Module) ProtoReflect() protoreflect.Message { + return (*fastReflection_Module)(x) +} + +func (x *Module) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_module_module_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Module_messageType fastReflection_Module_messageType +var _ protoreflect.MessageType = fastReflection_Module_messageType{} + +type fastReflection_Module_messageType struct{} + +func (x fastReflection_Module_messageType) Zero() protoreflect.Message { + return (*fastReflection_Module)(nil) +} +func (x fastReflection_Module_messageType) New() protoreflect.Message { + return new(fastReflection_Module) +} +func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Module) Type() protoreflect.MessageType { + return _fastReflection_Module_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Module) New() protoreflect.Message { + return new(fastReflection_Module) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage { + return (*Module)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Authority != "" { + value := protoreflect.ValueOfString(x.Authority) + if !f(fd_Module_authority, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.module.Module.authority": + return x.Authority != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.module.Module")) + } + panic(fmt.Errorf("message sourcehub.orbis.module.Module does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.module.Module.authority": + x.Authority = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.module.Module")) + } + panic(fmt.Errorf("message sourcehub.orbis.module.Module does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.module.Module.authority": + value := x.Authority + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.module.Module")) + } + panic(fmt.Errorf("message sourcehub.orbis.module.Module does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.module.Module.authority": + x.Authority = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.module.Module")) + } + panic(fmt.Errorf("message sourcehub.orbis.module.Module does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.module.Module.authority": + panic(fmt.Errorf("field authority of message sourcehub.orbis.module.Module is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.module.Module")) + } + panic(fmt.Errorf("message sourcehub.orbis.module.Module does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.module.Module.authority": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.module.Module")) + } + panic(fmt.Errorf("message sourcehub.orbis.module.Module does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.module.Module", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Module) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Module) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Authority) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Authority) > 0 { + i -= len(x.Authority) + copy(dAtA[i:], x.Authority) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) + i-- + dAtA[i] = 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().(*Module) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: sourcehub/orbis/module/module.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Module is the config object for the module. +type Module struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authority defines the custom module authority. If not set, defaults to the governance module. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (x *Module) Reset() { + *x = Module{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_module_module_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Module) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Module) ProtoMessage() {} + +// Deprecated: Use Module.ProtoReflect.Descriptor instead. +func (*Module) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_module_module_proto_rawDescGZIP(), []int{0} +} + +func (x *Module) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +var File_sourcehub_orbis_module_module_proto protoreflect.FileDescriptor + +var file_sourcehub_orbis_module_module_proto_rawDesc = []byte{ + 0x0a, 0x23, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x6f, 0x72, 0x62, 0x69, + 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, + 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x1a, 0x20, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x5a, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x32, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x2c, 0x0a, + 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x68, 0x75, 0x62, 0x2f, 0x78, 0x2f, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x42, 0xcc, 0x01, 0x0a, 0x1a, + 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, + 0x62, 0x69, 0x73, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0xa2, 0x02, 0x03, 0x53, 0x4f, 0x4d, 0xaa, 0x02, 0x16, 0x53, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x68, 0x75, 0x62, 0x2e, 0x4f, 0x72, 0x62, 0x69, 0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0xca, 0x02, 0x16, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x5c, 0x4f, 0x72, + 0x62, 0x69, 0x73, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0xe2, 0x02, 0x22, 0x53, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x5c, 0x4f, 0x72, 0x62, 0x69, 0x73, 0x5c, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x18, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x3a, 0x3a, 0x4f, 0x72, 0x62, + 0x69, 0x73, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_sourcehub_orbis_module_module_proto_rawDescOnce sync.Once + file_sourcehub_orbis_module_module_proto_rawDescData = file_sourcehub_orbis_module_module_proto_rawDesc +) + +func file_sourcehub_orbis_module_module_proto_rawDescGZIP() []byte { + file_sourcehub_orbis_module_module_proto_rawDescOnce.Do(func() { + file_sourcehub_orbis_module_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_sourcehub_orbis_module_module_proto_rawDescData) + }) + return file_sourcehub_orbis_module_module_proto_rawDescData +} + +var file_sourcehub_orbis_module_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_sourcehub_orbis_module_module_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: sourcehub.orbis.module.Module +} +var file_sourcehub_orbis_module_module_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_sourcehub_orbis_module_module_proto_init() } +func file_sourcehub_orbis_module_module_proto_init() { + if File_sourcehub_orbis_module_module_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_sourcehub_orbis_module_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Module); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_sourcehub_orbis_module_module_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_sourcehub_orbis_module_module_proto_goTypes, + DependencyIndexes: file_sourcehub_orbis_module_module_proto_depIdxs, + MessageInfos: file_sourcehub_orbis_module_module_proto_msgTypes, + }.Build() + File_sourcehub_orbis_module_module_proto = out.File + file_sourcehub_orbis_module_module_proto_rawDesc = nil + file_sourcehub_orbis_module_module_proto_goTypes = nil + file_sourcehub_orbis_module_module_proto_depIdxs = nil +} diff --git a/api/sourcehub/orbis/node_info.pulsar.go b/api/sourcehub/orbis/node_info.pulsar.go new file mode 100644 index 00000000..50e9b261 --- /dev/null +++ b/api/sourcehub/orbis/node_info.pulsar.go @@ -0,0 +1,1475 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package orbis + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var _ protoreflect.List = (*_NodeInfo_3_list)(nil) + +type _NodeInfo_3_list struct { + list *[]string +} + +func (x *_NodeInfo_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_NodeInfo_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_NodeInfo_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_NodeInfo_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_NodeInfo_3_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message NodeInfo at list field WhitelistedPolicyIds as it is not of Message kind")) +} + +func (x *_NodeInfo_3_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_NodeInfo_3_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_NodeInfo_3_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_NodeInfo_4_list)(nil) + +type _NodeInfo_4_list struct { + list *[]string +} + +func (x *_NodeInfo_4_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_NodeInfo_4_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_NodeInfo_4_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_NodeInfo_4_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_NodeInfo_4_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message NodeInfo at list field WhitelistedRingIds as it is not of Message kind")) +} + +func (x *_NodeInfo_4_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_NodeInfo_4_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_NodeInfo_4_list) IsValid() bool { + return x.list != nil +} + +var ( + md_NodeInfo protoreflect.MessageDescriptor + fd_NodeInfo_peer_id protoreflect.FieldDescriptor + fd_NodeInfo_controller_key protoreflect.FieldDescriptor + fd_NodeInfo_whitelisted_policy_ids protoreflect.FieldDescriptor + fd_NodeInfo_whitelisted_ring_ids protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_node_info_proto_init() + md_NodeInfo = File_sourcehub_orbis_node_info_proto.Messages().ByName("NodeInfo") + fd_NodeInfo_peer_id = md_NodeInfo.Fields().ByName("peer_id") + fd_NodeInfo_controller_key = md_NodeInfo.Fields().ByName("controller_key") + fd_NodeInfo_whitelisted_policy_ids = md_NodeInfo.Fields().ByName("whitelisted_policy_ids") + fd_NodeInfo_whitelisted_ring_ids = md_NodeInfo.Fields().ByName("whitelisted_ring_ids") +} + +var _ protoreflect.Message = (*fastReflection_NodeInfo)(nil) + +type fastReflection_NodeInfo NodeInfo + +func (x *NodeInfo) ProtoReflect() protoreflect.Message { + return (*fastReflection_NodeInfo)(x) +} + +func (x *NodeInfo) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_node_info_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_NodeInfo_messageType fastReflection_NodeInfo_messageType +var _ protoreflect.MessageType = fastReflection_NodeInfo_messageType{} + +type fastReflection_NodeInfo_messageType struct{} + +func (x fastReflection_NodeInfo_messageType) Zero() protoreflect.Message { + return (*fastReflection_NodeInfo)(nil) +} +func (x fastReflection_NodeInfo_messageType) New() protoreflect.Message { + return new(fastReflection_NodeInfo) +} +func (x fastReflection_NodeInfo_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_NodeInfo +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_NodeInfo) Descriptor() protoreflect.MessageDescriptor { + return md_NodeInfo +} + +// 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_NodeInfo) Type() protoreflect.MessageType { + return _fastReflection_NodeInfo_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_NodeInfo) New() protoreflect.Message { + return new(fastReflection_NodeInfo) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_NodeInfo) Interface() protoreflect.ProtoMessage { + return (*NodeInfo)(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_NodeInfo) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.PeerId != "" { + value := protoreflect.ValueOfString(x.PeerId) + if !f(fd_NodeInfo_peer_id, value) { + return + } + } + if x.ControllerKey != "" { + value := protoreflect.ValueOfString(x.ControllerKey) + if !f(fd_NodeInfo_controller_key, value) { + return + } + } + if len(x.WhitelistedPolicyIds) != 0 { + value := protoreflect.ValueOfList(&_NodeInfo_3_list{list: &x.WhitelistedPolicyIds}) + if !f(fd_NodeInfo_whitelisted_policy_ids, value) { + return + } + } + if len(x.WhitelistedRingIds) != 0 { + value := protoreflect.ValueOfList(&_NodeInfo_4_list{list: &x.WhitelistedRingIds}) + if !f(fd_NodeInfo_whitelisted_ring_ids, 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_NodeInfo) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.NodeInfo.peer_id": + return x.PeerId != "" + case "sourcehub.orbis.NodeInfo.controller_key": + return x.ControllerKey != "" + case "sourcehub.orbis.NodeInfo.whitelisted_policy_ids": + return len(x.WhitelistedPolicyIds) != 0 + case "sourcehub.orbis.NodeInfo.whitelisted_ring_ids": + return len(x.WhitelistedRingIds) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.NodeInfo")) + } + panic(fmt.Errorf("message sourcehub.orbis.NodeInfo 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_NodeInfo) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.NodeInfo.peer_id": + x.PeerId = "" + case "sourcehub.orbis.NodeInfo.controller_key": + x.ControllerKey = "" + case "sourcehub.orbis.NodeInfo.whitelisted_policy_ids": + x.WhitelistedPolicyIds = nil + case "sourcehub.orbis.NodeInfo.whitelisted_ring_ids": + x.WhitelistedRingIds = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.NodeInfo")) + } + panic(fmt.Errorf("message sourcehub.orbis.NodeInfo 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_NodeInfo) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.NodeInfo.peer_id": + value := x.PeerId + return protoreflect.ValueOfString(value) + case "sourcehub.orbis.NodeInfo.controller_key": + value := x.ControllerKey + return protoreflect.ValueOfString(value) + case "sourcehub.orbis.NodeInfo.whitelisted_policy_ids": + if len(x.WhitelistedPolicyIds) == 0 { + return protoreflect.ValueOfList(&_NodeInfo_3_list{}) + } + listValue := &_NodeInfo_3_list{list: &x.WhitelistedPolicyIds} + return protoreflect.ValueOfList(listValue) + case "sourcehub.orbis.NodeInfo.whitelisted_ring_ids": + if len(x.WhitelistedRingIds) == 0 { + return protoreflect.ValueOfList(&_NodeInfo_4_list{}) + } + listValue := &_NodeInfo_4_list{list: &x.WhitelistedRingIds} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.NodeInfo")) + } + panic(fmt.Errorf("message sourcehub.orbis.NodeInfo 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_NodeInfo) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.NodeInfo.peer_id": + x.PeerId = value.Interface().(string) + case "sourcehub.orbis.NodeInfo.controller_key": + x.ControllerKey = value.Interface().(string) + case "sourcehub.orbis.NodeInfo.whitelisted_policy_ids": + lv := value.List() + clv := lv.(*_NodeInfo_3_list) + x.WhitelistedPolicyIds = *clv.list + case "sourcehub.orbis.NodeInfo.whitelisted_ring_ids": + lv := value.List() + clv := lv.(*_NodeInfo_4_list) + x.WhitelistedRingIds = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.NodeInfo")) + } + panic(fmt.Errorf("message sourcehub.orbis.NodeInfo 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_NodeInfo) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.NodeInfo.whitelisted_policy_ids": + if x.WhitelistedPolicyIds == nil { + x.WhitelistedPolicyIds = []string{} + } + value := &_NodeInfo_3_list{list: &x.WhitelistedPolicyIds} + return protoreflect.ValueOfList(value) + case "sourcehub.orbis.NodeInfo.whitelisted_ring_ids": + if x.WhitelistedRingIds == nil { + x.WhitelistedRingIds = []string{} + } + value := &_NodeInfo_4_list{list: &x.WhitelistedRingIds} + return protoreflect.ValueOfList(value) + case "sourcehub.orbis.NodeInfo.peer_id": + panic(fmt.Errorf("field peer_id of message sourcehub.orbis.NodeInfo is not mutable")) + case "sourcehub.orbis.NodeInfo.controller_key": + panic(fmt.Errorf("field controller_key of message sourcehub.orbis.NodeInfo is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.NodeInfo")) + } + panic(fmt.Errorf("message sourcehub.orbis.NodeInfo 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_NodeInfo) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.NodeInfo.peer_id": + return protoreflect.ValueOfString("") + case "sourcehub.orbis.NodeInfo.controller_key": + return protoreflect.ValueOfString("") + case "sourcehub.orbis.NodeInfo.whitelisted_policy_ids": + list := []string{} + return protoreflect.ValueOfList(&_NodeInfo_3_list{list: &list}) + case "sourcehub.orbis.NodeInfo.whitelisted_ring_ids": + list := []string{} + return protoreflect.ValueOfList(&_NodeInfo_4_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.NodeInfo")) + } + panic(fmt.Errorf("message sourcehub.orbis.NodeInfo 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_NodeInfo) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.NodeInfo", 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_NodeInfo) 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_NodeInfo) 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_NodeInfo) 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_NodeInfo) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*NodeInfo) + 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.PeerId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ControllerKey) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.WhitelistedPolicyIds) > 0 { + for _, s := range x.WhitelistedPolicyIds { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if len(x.WhitelistedRingIds) > 0 { + for _, s := range x.WhitelistedRingIds { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*NodeInfo) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.WhitelistedRingIds) > 0 { + for iNdEx := len(x.WhitelistedRingIds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.WhitelistedRingIds[iNdEx]) + copy(dAtA[i:], x.WhitelistedRingIds[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.WhitelistedRingIds[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(x.WhitelistedPolicyIds) > 0 { + for iNdEx := len(x.WhitelistedPolicyIds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.WhitelistedPolicyIds[iNdEx]) + copy(dAtA[i:], x.WhitelistedPolicyIds[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.WhitelistedPolicyIds[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(x.ControllerKey) > 0 { + i -= len(x.ControllerKey) + copy(dAtA[i:], x.ControllerKey) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ControllerKey))) + i-- + dAtA[i] = 0x12 + } + if len(x.PeerId) > 0 { + i -= len(x.PeerId) + copy(dAtA[i:], x.PeerId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PeerId))) + 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().(*NodeInfo) + 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: NodeInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: NodeInfo: 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 PeerId", 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.PeerId = 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 ControllerKey", 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.ControllerKey = 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 WhitelistedPolicyIds", 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.WhitelistedPolicyIds = append(x.WhitelistedPolicyIds, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field WhitelistedRingIds", 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.WhitelistedRingIds = append(x.WhitelistedRingIds, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_NodeInfoEntry protoreflect.MessageDescriptor + fd_NodeInfoEntry_node_key protoreflect.FieldDescriptor + fd_NodeInfoEntry_node_info protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_node_info_proto_init() + md_NodeInfoEntry = File_sourcehub_orbis_node_info_proto.Messages().ByName("NodeInfoEntry") + fd_NodeInfoEntry_node_key = md_NodeInfoEntry.Fields().ByName("node_key") + fd_NodeInfoEntry_node_info = md_NodeInfoEntry.Fields().ByName("node_info") +} + +var _ protoreflect.Message = (*fastReflection_NodeInfoEntry)(nil) + +type fastReflection_NodeInfoEntry NodeInfoEntry + +func (x *NodeInfoEntry) ProtoReflect() protoreflect.Message { + return (*fastReflection_NodeInfoEntry)(x) +} + +func (x *NodeInfoEntry) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_node_info_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_NodeInfoEntry_messageType fastReflection_NodeInfoEntry_messageType +var _ protoreflect.MessageType = fastReflection_NodeInfoEntry_messageType{} + +type fastReflection_NodeInfoEntry_messageType struct{} + +func (x fastReflection_NodeInfoEntry_messageType) Zero() protoreflect.Message { + return (*fastReflection_NodeInfoEntry)(nil) +} +func (x fastReflection_NodeInfoEntry_messageType) New() protoreflect.Message { + return new(fastReflection_NodeInfoEntry) +} +func (x fastReflection_NodeInfoEntry_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_NodeInfoEntry +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_NodeInfoEntry) Descriptor() protoreflect.MessageDescriptor { + return md_NodeInfoEntry +} + +// 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_NodeInfoEntry) Type() protoreflect.MessageType { + return _fastReflection_NodeInfoEntry_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_NodeInfoEntry) New() protoreflect.Message { + return new(fastReflection_NodeInfoEntry) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_NodeInfoEntry) Interface() protoreflect.ProtoMessage { + return (*NodeInfoEntry)(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_NodeInfoEntry) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.NodeKey != "" { + value := protoreflect.ValueOfString(x.NodeKey) + if !f(fd_NodeInfoEntry_node_key, value) { + return + } + } + if x.NodeInfo != nil { + value := protoreflect.ValueOfMessage(x.NodeInfo.ProtoReflect()) + if !f(fd_NodeInfoEntry_node_info, 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_NodeInfoEntry) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.NodeInfoEntry.node_key": + return x.NodeKey != "" + case "sourcehub.orbis.NodeInfoEntry.node_info": + return x.NodeInfo != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.NodeInfoEntry")) + } + panic(fmt.Errorf("message sourcehub.orbis.NodeInfoEntry 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_NodeInfoEntry) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.NodeInfoEntry.node_key": + x.NodeKey = "" + case "sourcehub.orbis.NodeInfoEntry.node_info": + x.NodeInfo = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.NodeInfoEntry")) + } + panic(fmt.Errorf("message sourcehub.orbis.NodeInfoEntry 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_NodeInfoEntry) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.NodeInfoEntry.node_key": + value := x.NodeKey + return protoreflect.ValueOfString(value) + case "sourcehub.orbis.NodeInfoEntry.node_info": + value := x.NodeInfo + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.NodeInfoEntry")) + } + panic(fmt.Errorf("message sourcehub.orbis.NodeInfoEntry 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_NodeInfoEntry) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.NodeInfoEntry.node_key": + x.NodeKey = value.Interface().(string) + case "sourcehub.orbis.NodeInfoEntry.node_info": + x.NodeInfo = value.Message().Interface().(*NodeInfo) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.NodeInfoEntry")) + } + panic(fmt.Errorf("message sourcehub.orbis.NodeInfoEntry 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_NodeInfoEntry) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.NodeInfoEntry.node_info": + if x.NodeInfo == nil { + x.NodeInfo = new(NodeInfo) + } + return protoreflect.ValueOfMessage(x.NodeInfo.ProtoReflect()) + case "sourcehub.orbis.NodeInfoEntry.node_key": + panic(fmt.Errorf("field node_key of message sourcehub.orbis.NodeInfoEntry is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.NodeInfoEntry")) + } + panic(fmt.Errorf("message sourcehub.orbis.NodeInfoEntry 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_NodeInfoEntry) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.NodeInfoEntry.node_key": + return protoreflect.ValueOfString("") + case "sourcehub.orbis.NodeInfoEntry.node_info": + m := new(NodeInfo) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.NodeInfoEntry")) + } + panic(fmt.Errorf("message sourcehub.orbis.NodeInfoEntry 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_NodeInfoEntry) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.NodeInfoEntry", 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_NodeInfoEntry) 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_NodeInfoEntry) 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_NodeInfoEntry) 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_NodeInfoEntry) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*NodeInfoEntry) + 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.NodeKey) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.NodeInfo != nil { + l = options.Size(x.NodeInfo) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*NodeInfoEntry) + 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.NodeInfo != nil { + encoded, err := options.Marshal(x.NodeInfo) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.NodeKey) > 0 { + i -= len(x.NodeKey) + copy(dAtA[i:], x.NodeKey) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.NodeKey))) + 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().(*NodeInfoEntry) + 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: NodeInfoEntry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: NodeInfoEntry: 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 NodeKey", 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.NodeKey = 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 NodeInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.NodeInfo == nil { + x.NodeInfo = &NodeInfo{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.NodeInfo); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: sourcehub/orbis/node_info.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// NodeInfo stores access-control metadata for a node participating in Orbis rings. +type NodeInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` + ControllerKey string `protobuf:"bytes,2,opt,name=controller_key,json=controllerKey,proto3" json:"controller_key,omitempty"` + WhitelistedPolicyIds []string `protobuf:"bytes,3,rep,name=whitelisted_policy_ids,json=whitelistedPolicyIds,proto3" json:"whitelisted_policy_ids,omitempty"` + WhitelistedRingIds []string `protobuf:"bytes,4,rep,name=whitelisted_ring_ids,json=whitelistedRingIds,proto3" json:"whitelisted_ring_ids,omitempty"` +} + +func (x *NodeInfo) Reset() { + *x = NodeInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_node_info_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NodeInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NodeInfo) ProtoMessage() {} + +// Deprecated: Use NodeInfo.ProtoReflect.Descriptor instead. +func (*NodeInfo) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_node_info_proto_rawDescGZIP(), []int{0} +} + +func (x *NodeInfo) GetPeerId() string { + if x != nil { + return x.PeerId + } + return "" +} + +func (x *NodeInfo) GetControllerKey() string { + if x != nil { + return x.ControllerKey + } + return "" +} + +func (x *NodeInfo) GetWhitelistedPolicyIds() []string { + if x != nil { + return x.WhitelistedPolicyIds + } + return nil +} + +func (x *NodeInfo) GetWhitelistedRingIds() []string { + if x != nil { + return x.WhitelistedRingIds + } + return nil +} + +// NodeInfoEntry pairs a node_key with its NodeInfo for genesis export/import. +type NodeInfoEntry struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` + NodeInfo *NodeInfo `protobuf:"bytes,2,opt,name=node_info,json=nodeInfo,proto3" json:"node_info,omitempty"` +} + +func (x *NodeInfoEntry) Reset() { + *x = NodeInfoEntry{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_node_info_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NodeInfoEntry) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NodeInfoEntry) ProtoMessage() {} + +// Deprecated: Use NodeInfoEntry.ProtoReflect.Descriptor instead. +func (*NodeInfoEntry) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_node_info_proto_rawDescGZIP(), []int{1} +} + +func (x *NodeInfoEntry) GetNodeKey() string { + if x != nil { + return x.NodeKey + } + return "" +} + +func (x *NodeInfoEntry) GetNodeInfo() *NodeInfo { + if x != nil { + return x.NodeInfo + } + return nil +} + +var File_sourcehub_orbis_node_info_proto protoreflect.FileDescriptor + +var file_sourcehub_orbis_node_info_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x6f, 0x72, 0x62, 0x69, + 0x73, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, + 0x69, 0x73, 0x22, 0xb2, 0x01, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x17, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x4b, 0x65, 0x79, 0x12, + 0x34, 0x0a, 0x16, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x70, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x14, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x49, 0x64, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, + 0x73, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x12, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, + 0x52, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x73, 0x22, 0x62, 0x0a, 0x0d, 0x4e, 0x6f, 0x64, 0x65, 0x49, + 0x6e, 0x66, 0x6f, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, + 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, + 0x4b, 0x65, 0x79, 0x12, 0x36, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, + 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0xa3, 0x01, 0x0a, 0x13, + 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, + 0x62, 0x69, 0x73, 0x42, 0x0d, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, + 0x2f, 0x6f, 0x72, 0x62, 0x69, 0x73, 0xa2, 0x02, 0x03, 0x53, 0x4f, 0x58, 0xaa, 0x02, 0x0f, 0x53, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x4f, 0x72, 0x62, 0x69, 0x73, 0xca, 0x02, + 0x0f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x5c, 0x4f, 0x72, 0x62, 0x69, 0x73, + 0xe2, 0x02, 0x1b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x5c, 0x4f, 0x72, 0x62, + 0x69, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x10, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x3a, 0x3a, 0x4f, 0x72, 0x62, 0x69, + 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_sourcehub_orbis_node_info_proto_rawDescOnce sync.Once + file_sourcehub_orbis_node_info_proto_rawDescData = file_sourcehub_orbis_node_info_proto_rawDesc +) + +func file_sourcehub_orbis_node_info_proto_rawDescGZIP() []byte { + file_sourcehub_orbis_node_info_proto_rawDescOnce.Do(func() { + file_sourcehub_orbis_node_info_proto_rawDescData = protoimpl.X.CompressGZIP(file_sourcehub_orbis_node_info_proto_rawDescData) + }) + return file_sourcehub_orbis_node_info_proto_rawDescData +} + +var file_sourcehub_orbis_node_info_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_sourcehub_orbis_node_info_proto_goTypes = []interface{}{ + (*NodeInfo)(nil), // 0: sourcehub.orbis.NodeInfo + (*NodeInfoEntry)(nil), // 1: sourcehub.orbis.NodeInfoEntry +} +var file_sourcehub_orbis_node_info_proto_depIdxs = []int32{ + 0, // 0: sourcehub.orbis.NodeInfoEntry.node_info:type_name -> sourcehub.orbis.NodeInfo + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_sourcehub_orbis_node_info_proto_init() } +func file_sourcehub_orbis_node_info_proto_init() { + if File_sourcehub_orbis_node_info_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_sourcehub_orbis_node_info_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NodeInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sourcehub_orbis_node_info_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NodeInfoEntry); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_sourcehub_orbis_node_info_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_sourcehub_orbis_node_info_proto_goTypes, + DependencyIndexes: file_sourcehub_orbis_node_info_proto_depIdxs, + MessageInfos: file_sourcehub_orbis_node_info_proto_msgTypes, + }.Build() + File_sourcehub_orbis_node_info_proto = out.File + file_sourcehub_orbis_node_info_proto_rawDesc = nil + file_sourcehub_orbis_node_info_proto_goTypes = nil + file_sourcehub_orbis_node_info_proto_depIdxs = nil +} diff --git a/api/sourcehub/orbis/params.pulsar.go b/api/sourcehub/orbis/params.pulsar.go new file mode 100644 index 00000000..8a4a4db2 --- /dev/null +++ b/api/sourcehub/orbis/params.pulsar.go @@ -0,0 +1,499 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package orbis + +import ( + _ "cosmossdk.io/api/amino" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Params protoreflect.MessageDescriptor +) + +func init() { + file_sourcehub_orbis_params_proto_init() + md_Params = File_sourcehub_orbis_params_proto.Messages().ByName("Params") +} + +var _ protoreflect.Message = (*fastReflection_Params)(nil) + +type fastReflection_Params Params + +func (x *Params) ProtoReflect() protoreflect.Message { + return (*fastReflection_Params)(x) +} + +func (x *Params) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_params_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Params_messageType fastReflection_Params_messageType +var _ protoreflect.MessageType = fastReflection_Params_messageType{} + +type fastReflection_Params_messageType struct{} + +func (x fastReflection_Params_messageType) Zero() protoreflect.Message { + return (*fastReflection_Params)(nil) +} +func (x fastReflection_Params_messageType) New() protoreflect.Message { + return new(fastReflection_Params) +} +func (x fastReflection_Params_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Params) Descriptor() protoreflect.MessageDescriptor { + return md_Params +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Params) Type() protoreflect.MessageType { + return _fastReflection_Params_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Params) New() protoreflect.Message { + return new(fastReflection_Params) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { + return (*Params)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.Params")) + } + panic(fmt.Errorf("message sourcehub.orbis.Params does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.Params")) + } + panic(fmt.Errorf("message sourcehub.orbis.Params does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.Params")) + } + panic(fmt.Errorf("message sourcehub.orbis.Params does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.Params")) + } + panic(fmt.Errorf("message sourcehub.orbis.Params does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.Params")) + } + panic(fmt.Errorf("message sourcehub.orbis.Params does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.Params")) + } + panic(fmt.Errorf("message sourcehub.orbis.Params does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Params) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.Params", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Params) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Params) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Params) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Params) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: sourcehub/orbis/params.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Params defines the parameters for the module. +type Params struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Params) Reset() { + *x = Params{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_params_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Params) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Params) ProtoMessage() {} + +// Deprecated: Use Params.ProtoReflect.Descriptor instead. +func (*Params) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_params_proto_rawDescGZIP(), []int{0} +} + +var File_sourcehub_orbis_params_proto protoreflect.FileDescriptor + +var file_sourcehub_orbis_params_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x6f, 0x72, 0x62, 0x69, + 0x73, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x1a, + 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, + 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2b, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x3a, 0x21, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x18, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x78, 0x2f, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2f, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xa1, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x42, 0x0b, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x6f, 0x72, 0x62, 0x69, 0x73, 0xa2, 0x02, + 0x03, 0x53, 0x4f, 0x58, 0xaa, 0x02, 0x0f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, + 0x2e, 0x4f, 0x72, 0x62, 0x69, 0x73, 0xca, 0x02, 0x0f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, + 0x75, 0x62, 0x5c, 0x4f, 0x72, 0x62, 0x69, 0x73, 0xe2, 0x02, 0x1b, 0x53, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x68, 0x75, 0x62, 0x5c, 0x4f, 0x72, 0x62, 0x69, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, + 0x75, 0x62, 0x3a, 0x3a, 0x4f, 0x72, 0x62, 0x69, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_sourcehub_orbis_params_proto_rawDescOnce sync.Once + file_sourcehub_orbis_params_proto_rawDescData = file_sourcehub_orbis_params_proto_rawDesc +) + +func file_sourcehub_orbis_params_proto_rawDescGZIP() []byte { + file_sourcehub_orbis_params_proto_rawDescOnce.Do(func() { + file_sourcehub_orbis_params_proto_rawDescData = protoimpl.X.CompressGZIP(file_sourcehub_orbis_params_proto_rawDescData) + }) + return file_sourcehub_orbis_params_proto_rawDescData +} + +var file_sourcehub_orbis_params_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_sourcehub_orbis_params_proto_goTypes = []interface{}{ + (*Params)(nil), // 0: sourcehub.orbis.Params +} +var file_sourcehub_orbis_params_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_sourcehub_orbis_params_proto_init() } +func file_sourcehub_orbis_params_proto_init() { + if File_sourcehub_orbis_params_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_sourcehub_orbis_params_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Params); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_sourcehub_orbis_params_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_sourcehub_orbis_params_proto_goTypes, + DependencyIndexes: file_sourcehub_orbis_params_proto_depIdxs, + MessageInfos: file_sourcehub_orbis_params_proto_msgTypes, + }.Build() + File_sourcehub_orbis_params_proto = out.File + file_sourcehub_orbis_params_proto_rawDesc = nil + file_sourcehub_orbis_params_proto_goTypes = nil + file_sourcehub_orbis_params_proto_depIdxs = nil +} diff --git a/api/sourcehub/orbis/query.pulsar.go b/api/sourcehub/orbis/query.pulsar.go new file mode 100644 index 00000000..afe32edc --- /dev/null +++ b/api/sourcehub/orbis/query.pulsar.go @@ -0,0 +1,8340 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package orbis + +import ( + _ "cosmossdk.io/api/amino" + v1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_QueryParamsRequest protoreflect.MessageDescriptor +) + +func init() { + file_sourcehub_orbis_query_proto_init() + md_QueryParamsRequest = File_sourcehub_orbis_query_proto.Messages().ByName("QueryParamsRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsRequest)(nil) + +type fastReflection_QueryParamsRequest QueryParamsRequest + +func (x *QueryParamsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(x) +} + +func (x *QueryParamsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_query_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryParamsRequest_messageType fastReflection_QueryParamsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsRequest_messageType{} + +type fastReflection_QueryParamsRequest_messageType struct{} + +func (x fastReflection_QueryParamsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsRequest)(nil) +} +func (x fastReflection_QueryParamsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} +func (x fastReflection_QueryParamsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryParamsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsRequest) New() protoreflect.Message { + return new(fastReflection_QueryParamsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryParamsRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryParamsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryParamsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryParamsRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryParamsRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryParamsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryParamsRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryParamsRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryParamsRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryParamsRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryParamsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryParamsRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryParamsRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryParamsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.QueryParamsRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryParamsRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryParamsRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryParamsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryParamsResponse protoreflect.MessageDescriptor + fd_QueryParamsResponse_params protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_query_proto_init() + md_QueryParamsResponse = File_sourcehub_orbis_query_proto.Messages().ByName("QueryParamsResponse") + fd_QueryParamsResponse_params = md_QueryParamsResponse.Fields().ByName("params") +} + +var _ protoreflect.Message = (*fastReflection_QueryParamsResponse)(nil) + +type fastReflection_QueryParamsResponse QueryParamsResponse + +func (x *QueryParamsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(x) +} + +func (x *QueryParamsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_query_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryParamsResponse_messageType fastReflection_QueryParamsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryParamsResponse_messageType{} + +type fastReflection_QueryParamsResponse_messageType struct{} + +func (x fastReflection_QueryParamsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryParamsResponse)(nil) +} +func (x fastReflection_QueryParamsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} +func (x fastReflection_QueryParamsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryParamsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryParamsResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryParamsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryParamsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryParamsResponse) New() protoreflect.Message { + return new(fastReflection_QueryParamsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryParamsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryParamsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryParamsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Params != nil { + value := protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + if !f(fd_QueryParamsResponse_params, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryParamsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.QueryParamsResponse.params": + return x.Params != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryParamsResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.QueryParamsResponse.params": + x.Params = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryParamsResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryParamsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.QueryParamsResponse.params": + value := x.Params + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryParamsResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryParamsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.QueryParamsResponse.params": + x.Params = value.Message().Interface().(*Params) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryParamsResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryParamsResponse.params": + if x.Params == nil { + x.Params = new(Params) + } + return protoreflect.ValueOfMessage(x.Params.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryParamsResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryParamsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryParamsResponse.params": + m := new(Params) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryParamsResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryParamsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryParamsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.QueryParamsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryParamsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryParamsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryParamsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Params != nil { + l = options.Size(x.Params) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Params != nil { + encoded, err := options.Marshal(x.Params) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryParamsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Params == nil { + x.Params = &Params{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Params); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryRingRequest protoreflect.MessageDescriptor + fd_QueryRingRequest_id protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_query_proto_init() + md_QueryRingRequest = File_sourcehub_orbis_query_proto.Messages().ByName("QueryRingRequest") + fd_QueryRingRequest_id = md_QueryRingRequest.Fields().ByName("id") +} + +var _ protoreflect.Message = (*fastReflection_QueryRingRequest)(nil) + +type fastReflection_QueryRingRequest QueryRingRequest + +func (x *QueryRingRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryRingRequest)(x) +} + +func (x *QueryRingRequest) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_query_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryRingRequest_messageType fastReflection_QueryRingRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryRingRequest_messageType{} + +type fastReflection_QueryRingRequest_messageType struct{} + +func (x fastReflection_QueryRingRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryRingRequest)(nil) +} +func (x fastReflection_QueryRingRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryRingRequest) +} +func (x fastReflection_QueryRingRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRingRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryRingRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRingRequest +} + +// 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_QueryRingRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryRingRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryRingRequest) New() protoreflect.Message { + return new(fastReflection_QueryRingRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryRingRequest) Interface() protoreflect.ProtoMessage { + return (*QueryRingRequest)(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_QueryRingRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_QueryRingRequest_id, 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_QueryRingRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.QueryRingRequest.id": + return x.Id != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryRingRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryRingRequest 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_QueryRingRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.QueryRingRequest.id": + x.Id = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryRingRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryRingRequest 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_QueryRingRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.QueryRingRequest.id": + value := x.Id + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryRingRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryRingRequest 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_QueryRingRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.QueryRingRequest.id": + x.Id = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryRingRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryRingRequest 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_QueryRingRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryRingRequest.id": + panic(fmt.Errorf("field id of message sourcehub.orbis.QueryRingRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryRingRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryRingRequest 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_QueryRingRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryRingRequest.id": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryRingRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryRingRequest 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_QueryRingRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.QueryRingRequest", 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_QueryRingRequest) 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_QueryRingRequest) 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_QueryRingRequest) 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_QueryRingRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryRingRequest) + 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.Id) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryRingRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Id) > 0 { + i -= len(x.Id) + copy(dAtA[i:], x.Id) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + 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().(*QueryRingRequest) + 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: QueryRingRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryRingRequest: 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 Id", 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.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryRingResponse protoreflect.MessageDescriptor + fd_QueryRingResponse_ring protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_query_proto_init() + md_QueryRingResponse = File_sourcehub_orbis_query_proto.Messages().ByName("QueryRingResponse") + fd_QueryRingResponse_ring = md_QueryRingResponse.Fields().ByName("ring") +} + +var _ protoreflect.Message = (*fastReflection_QueryRingResponse)(nil) + +type fastReflection_QueryRingResponse QueryRingResponse + +func (x *QueryRingResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryRingResponse)(x) +} + +func (x *QueryRingResponse) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_query_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryRingResponse_messageType fastReflection_QueryRingResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryRingResponse_messageType{} + +type fastReflection_QueryRingResponse_messageType struct{} + +func (x fastReflection_QueryRingResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryRingResponse)(nil) +} +func (x fastReflection_QueryRingResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryRingResponse) +} +func (x fastReflection_QueryRingResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRingResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryRingResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRingResponse +} + +// 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_QueryRingResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryRingResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryRingResponse) New() protoreflect.Message { + return new(fastReflection_QueryRingResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryRingResponse) Interface() protoreflect.ProtoMessage { + return (*QueryRingResponse)(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_QueryRingResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Ring != nil { + value := protoreflect.ValueOfMessage(x.Ring.ProtoReflect()) + if !f(fd_QueryRingResponse_ring, 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_QueryRingResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.QueryRingResponse.ring": + return x.Ring != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryRingResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryRingResponse 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_QueryRingResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.QueryRingResponse.ring": + x.Ring = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryRingResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryRingResponse 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_QueryRingResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.QueryRingResponse.ring": + value := x.Ring + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryRingResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryRingResponse 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_QueryRingResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.QueryRingResponse.ring": + x.Ring = value.Message().Interface().(*Ring) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryRingResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryRingResponse 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_QueryRingResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryRingResponse.ring": + if x.Ring == nil { + x.Ring = new(Ring) + } + return protoreflect.ValueOfMessage(x.Ring.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryRingResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryRingResponse 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_QueryRingResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryRingResponse.ring": + m := new(Ring) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryRingResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryRingResponse 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_QueryRingResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.QueryRingResponse", 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_QueryRingResponse) 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_QueryRingResponse) 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_QueryRingResponse) 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_QueryRingResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryRingResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Ring != nil { + l = options.Size(x.Ring) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryRingResponse) + 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.Ring != nil { + encoded, err := options.Marshal(x.Ring) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryRingResponse) + 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: QueryRingResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryRingResponse: 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 Ring", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Ring == nil { + x.Ring = &Ring{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Ring); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryRingsRequest protoreflect.MessageDescriptor + fd_QueryRingsRequest_pagination protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_query_proto_init() + md_QueryRingsRequest = File_sourcehub_orbis_query_proto.Messages().ByName("QueryRingsRequest") + fd_QueryRingsRequest_pagination = md_QueryRingsRequest.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryRingsRequest)(nil) + +type fastReflection_QueryRingsRequest QueryRingsRequest + +func (x *QueryRingsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryRingsRequest)(x) +} + +func (x *QueryRingsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_query_proto_msgTypes[4] + 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_QueryRingsRequest_messageType fastReflection_QueryRingsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryRingsRequest_messageType{} + +type fastReflection_QueryRingsRequest_messageType struct{} + +func (x fastReflection_QueryRingsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryRingsRequest)(nil) +} +func (x fastReflection_QueryRingsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryRingsRequest) +} +func (x fastReflection_QueryRingsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRingsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryRingsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRingsRequest +} + +// 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_QueryRingsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryRingsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryRingsRequest) New() protoreflect.Message { + return new(fastReflection_QueryRingsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryRingsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryRingsRequest)(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_QueryRingsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryRingsRequest_pagination, 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_QueryRingsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.QueryRingsRequest.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryRingsRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryRingsRequest 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_QueryRingsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.QueryRingsRequest.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryRingsRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryRingsRequest 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_QueryRingsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.QueryRingsRequest.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryRingsRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryRingsRequest 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_QueryRingsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.QueryRingsRequest.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryRingsRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryRingsRequest 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_QueryRingsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryRingsRequest.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageRequest) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryRingsRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryRingsRequest 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_QueryRingsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryRingsRequest.pagination": + m := new(v1beta1.PageRequest) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryRingsRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryRingsRequest 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_QueryRingsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.QueryRingsRequest", 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_QueryRingsRequest) 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_QueryRingsRequest) 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_QueryRingsRequest) 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_QueryRingsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryRingsRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryRingsRequest) + 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.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryRingsRequest) + 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: QueryRingsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryRingsRequest: 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 Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pagination == nil { + x.Pagination = &v1beta1.PageRequest{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_QueryRingsResponse_1_list)(nil) + +type _QueryRingsResponse_1_list struct { + list *[]*Ring +} + +func (x *_QueryRingsResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryRingsResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryRingsResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Ring) + (*x.list)[i] = concreteValue +} + +func (x *_QueryRingsResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Ring) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryRingsResponse_1_list) AppendMutable() protoreflect.Value { + v := new(Ring) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryRingsResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryRingsResponse_1_list) NewElement() protoreflect.Value { + v := new(Ring) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryRingsResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryRingsResponse protoreflect.MessageDescriptor + fd_QueryRingsResponse_rings protoreflect.FieldDescriptor + fd_QueryRingsResponse_pagination protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_query_proto_init() + md_QueryRingsResponse = File_sourcehub_orbis_query_proto.Messages().ByName("QueryRingsResponse") + fd_QueryRingsResponse_rings = md_QueryRingsResponse.Fields().ByName("rings") + fd_QueryRingsResponse_pagination = md_QueryRingsResponse.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryRingsResponse)(nil) + +type fastReflection_QueryRingsResponse QueryRingsResponse + +func (x *QueryRingsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryRingsResponse)(x) +} + +func (x *QueryRingsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_query_proto_msgTypes[5] + 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_QueryRingsResponse_messageType fastReflection_QueryRingsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryRingsResponse_messageType{} + +type fastReflection_QueryRingsResponse_messageType struct{} + +func (x fastReflection_QueryRingsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryRingsResponse)(nil) +} +func (x fastReflection_QueryRingsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryRingsResponse) +} +func (x fastReflection_QueryRingsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRingsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryRingsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryRingsResponse +} + +// 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_QueryRingsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryRingsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryRingsResponse) New() protoreflect.Message { + return new(fastReflection_QueryRingsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryRingsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryRingsResponse)(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_QueryRingsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Rings) != 0 { + value := protoreflect.ValueOfList(&_QueryRingsResponse_1_list{list: &x.Rings}) + if !f(fd_QueryRingsResponse_rings, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryRingsResponse_pagination, 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_QueryRingsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.QueryRingsResponse.rings": + return len(x.Rings) != 0 + case "sourcehub.orbis.QueryRingsResponse.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryRingsResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryRingsResponse 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_QueryRingsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.QueryRingsResponse.rings": + x.Rings = nil + case "sourcehub.orbis.QueryRingsResponse.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryRingsResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryRingsResponse 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_QueryRingsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.QueryRingsResponse.rings": + if len(x.Rings) == 0 { + return protoreflect.ValueOfList(&_QueryRingsResponse_1_list{}) + } + listValue := &_QueryRingsResponse_1_list{list: &x.Rings} + return protoreflect.ValueOfList(listValue) + case "sourcehub.orbis.QueryRingsResponse.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryRingsResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryRingsResponse 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_QueryRingsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.QueryRingsResponse.rings": + lv := value.List() + clv := lv.(*_QueryRingsResponse_1_list) + x.Rings = *clv.list + case "sourcehub.orbis.QueryRingsResponse.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageResponse) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryRingsResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryRingsResponse 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_QueryRingsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryRingsResponse.rings": + if x.Rings == nil { + x.Rings = []*Ring{} + } + value := &_QueryRingsResponse_1_list{list: &x.Rings} + return protoreflect.ValueOfList(value) + case "sourcehub.orbis.QueryRingsResponse.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageResponse) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryRingsResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryRingsResponse 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_QueryRingsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryRingsResponse.rings": + list := []*Ring{} + return protoreflect.ValueOfList(&_QueryRingsResponse_1_list{list: &list}) + case "sourcehub.orbis.QueryRingsResponse.pagination": + m := new(v1beta1.PageResponse) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryRingsResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryRingsResponse 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_QueryRingsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.QueryRingsResponse", 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_QueryRingsResponse) 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_QueryRingsResponse) 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_QueryRingsResponse) 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_QueryRingsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryRingsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Rings) > 0 { + for _, e := range x.Rings { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryRingsResponse) + 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.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Rings) > 0 { + for iNdEx := len(x.Rings) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Rings[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryRingsResponse) + 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: QueryRingsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryRingsResponse: 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 Rings", 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.Rings = append(x.Rings, &Ring{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Rings[len(x.Rings)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pagination == nil { + x.Pagination = &v1beta1.PageResponse{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryDocumentRequest protoreflect.MessageDescriptor + fd_QueryDocumentRequest_id protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_query_proto_init() + md_QueryDocumentRequest = File_sourcehub_orbis_query_proto.Messages().ByName("QueryDocumentRequest") + fd_QueryDocumentRequest_id = md_QueryDocumentRequest.Fields().ByName("id") +} + +var _ protoreflect.Message = (*fastReflection_QueryDocumentRequest)(nil) + +type fastReflection_QueryDocumentRequest QueryDocumentRequest + +func (x *QueryDocumentRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryDocumentRequest)(x) +} + +func (x *QueryDocumentRequest) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_query_proto_msgTypes[6] + 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_QueryDocumentRequest_messageType fastReflection_QueryDocumentRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryDocumentRequest_messageType{} + +type fastReflection_QueryDocumentRequest_messageType struct{} + +func (x fastReflection_QueryDocumentRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryDocumentRequest)(nil) +} +func (x fastReflection_QueryDocumentRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryDocumentRequest) +} +func (x fastReflection_QueryDocumentRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDocumentRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryDocumentRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDocumentRequest +} + +// 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_QueryDocumentRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryDocumentRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryDocumentRequest) New() protoreflect.Message { + return new(fastReflection_QueryDocumentRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryDocumentRequest) Interface() protoreflect.ProtoMessage { + return (*QueryDocumentRequest)(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_QueryDocumentRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_QueryDocumentRequest_id, 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_QueryDocumentRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.QueryDocumentRequest.id": + return x.Id != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryDocumentRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryDocumentRequest 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_QueryDocumentRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.QueryDocumentRequest.id": + x.Id = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryDocumentRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryDocumentRequest 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_QueryDocumentRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.QueryDocumentRequest.id": + value := x.Id + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryDocumentRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryDocumentRequest 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_QueryDocumentRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.QueryDocumentRequest.id": + x.Id = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryDocumentRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryDocumentRequest 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_QueryDocumentRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryDocumentRequest.id": + panic(fmt.Errorf("field id of message sourcehub.orbis.QueryDocumentRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryDocumentRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryDocumentRequest 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_QueryDocumentRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryDocumentRequest.id": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryDocumentRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryDocumentRequest 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_QueryDocumentRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.QueryDocumentRequest", 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_QueryDocumentRequest) 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_QueryDocumentRequest) 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_QueryDocumentRequest) 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_QueryDocumentRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryDocumentRequest) + 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.Id) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryDocumentRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Id) > 0 { + i -= len(x.Id) + copy(dAtA[i:], x.Id) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + 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().(*QueryDocumentRequest) + 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: QueryDocumentRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryDocumentRequest: 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 Id", 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.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryDocumentResponse protoreflect.MessageDescriptor + fd_QueryDocumentResponse_document protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_query_proto_init() + md_QueryDocumentResponse = File_sourcehub_orbis_query_proto.Messages().ByName("QueryDocumentResponse") + fd_QueryDocumentResponse_document = md_QueryDocumentResponse.Fields().ByName("document") +} + +var _ protoreflect.Message = (*fastReflection_QueryDocumentResponse)(nil) + +type fastReflection_QueryDocumentResponse QueryDocumentResponse + +func (x *QueryDocumentResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryDocumentResponse)(x) +} + +func (x *QueryDocumentResponse) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_query_proto_msgTypes[7] + 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_QueryDocumentResponse_messageType fastReflection_QueryDocumentResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryDocumentResponse_messageType{} + +type fastReflection_QueryDocumentResponse_messageType struct{} + +func (x fastReflection_QueryDocumentResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryDocumentResponse)(nil) +} +func (x fastReflection_QueryDocumentResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryDocumentResponse) +} +func (x fastReflection_QueryDocumentResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDocumentResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryDocumentResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDocumentResponse +} + +// 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_QueryDocumentResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryDocumentResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryDocumentResponse) New() protoreflect.Message { + return new(fastReflection_QueryDocumentResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryDocumentResponse) Interface() protoreflect.ProtoMessage { + return (*QueryDocumentResponse)(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_QueryDocumentResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Document != nil { + value := protoreflect.ValueOfMessage(x.Document.ProtoReflect()) + if !f(fd_QueryDocumentResponse_document, 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_QueryDocumentResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.QueryDocumentResponse.document": + return x.Document != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryDocumentResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryDocumentResponse 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_QueryDocumentResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.QueryDocumentResponse.document": + x.Document = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryDocumentResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryDocumentResponse 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_QueryDocumentResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.QueryDocumentResponse.document": + value := x.Document + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryDocumentResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryDocumentResponse 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_QueryDocumentResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.QueryDocumentResponse.document": + x.Document = value.Message().Interface().(*Document) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryDocumentResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryDocumentResponse 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_QueryDocumentResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryDocumentResponse.document": + if x.Document == nil { + x.Document = new(Document) + } + return protoreflect.ValueOfMessage(x.Document.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryDocumentResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryDocumentResponse 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_QueryDocumentResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryDocumentResponse.document": + m := new(Document) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryDocumentResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryDocumentResponse 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_QueryDocumentResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.QueryDocumentResponse", 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_QueryDocumentResponse) 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_QueryDocumentResponse) 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_QueryDocumentResponse) 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_QueryDocumentResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryDocumentResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Document != nil { + l = options.Size(x.Document) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryDocumentResponse) + 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.Document != nil { + encoded, err := options.Marshal(x.Document) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryDocumentResponse) + 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: QueryDocumentResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryDocumentResponse: 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 Document", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Document == nil { + x.Document = &Document{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Document); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryDocumentsRequest protoreflect.MessageDescriptor + fd_QueryDocumentsRequest_pagination protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_query_proto_init() + md_QueryDocumentsRequest = File_sourcehub_orbis_query_proto.Messages().ByName("QueryDocumentsRequest") + fd_QueryDocumentsRequest_pagination = md_QueryDocumentsRequest.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryDocumentsRequest)(nil) + +type fastReflection_QueryDocumentsRequest QueryDocumentsRequest + +func (x *QueryDocumentsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryDocumentsRequest)(x) +} + +func (x *QueryDocumentsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_query_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryDocumentsRequest_messageType fastReflection_QueryDocumentsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryDocumentsRequest_messageType{} + +type fastReflection_QueryDocumentsRequest_messageType struct{} + +func (x fastReflection_QueryDocumentsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryDocumentsRequest)(nil) +} +func (x fastReflection_QueryDocumentsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryDocumentsRequest) +} +func (x fastReflection_QueryDocumentsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDocumentsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryDocumentsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDocumentsRequest +} + +// 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_QueryDocumentsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryDocumentsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryDocumentsRequest) New() protoreflect.Message { + return new(fastReflection_QueryDocumentsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryDocumentsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryDocumentsRequest)(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_QueryDocumentsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryDocumentsRequest_pagination, 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_QueryDocumentsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.QueryDocumentsRequest.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryDocumentsRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryDocumentsRequest 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_QueryDocumentsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.QueryDocumentsRequest.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryDocumentsRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryDocumentsRequest 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_QueryDocumentsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.QueryDocumentsRequest.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryDocumentsRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryDocumentsRequest 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_QueryDocumentsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.QueryDocumentsRequest.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryDocumentsRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryDocumentsRequest 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_QueryDocumentsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryDocumentsRequest.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageRequest) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryDocumentsRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryDocumentsRequest 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_QueryDocumentsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryDocumentsRequest.pagination": + m := new(v1beta1.PageRequest) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryDocumentsRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryDocumentsRequest 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_QueryDocumentsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.QueryDocumentsRequest", 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_QueryDocumentsRequest) 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_QueryDocumentsRequest) 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_QueryDocumentsRequest) 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_QueryDocumentsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryDocumentsRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryDocumentsRequest) + 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.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryDocumentsRequest) + 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: QueryDocumentsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryDocumentsRequest: 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 Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pagination == nil { + x.Pagination = &v1beta1.PageRequest{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_QueryDocumentsResponse_1_list)(nil) + +type _QueryDocumentsResponse_1_list struct { + list *[]*Document +} + +func (x *_QueryDocumentsResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryDocumentsResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryDocumentsResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Document) + (*x.list)[i] = concreteValue +} + +func (x *_QueryDocumentsResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*Document) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryDocumentsResponse_1_list) AppendMutable() protoreflect.Value { + v := new(Document) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryDocumentsResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryDocumentsResponse_1_list) NewElement() protoreflect.Value { + v := new(Document) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryDocumentsResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryDocumentsResponse protoreflect.MessageDescriptor + fd_QueryDocumentsResponse_documents protoreflect.FieldDescriptor + fd_QueryDocumentsResponse_pagination protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_query_proto_init() + md_QueryDocumentsResponse = File_sourcehub_orbis_query_proto.Messages().ByName("QueryDocumentsResponse") + fd_QueryDocumentsResponse_documents = md_QueryDocumentsResponse.Fields().ByName("documents") + fd_QueryDocumentsResponse_pagination = md_QueryDocumentsResponse.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryDocumentsResponse)(nil) + +type fastReflection_QueryDocumentsResponse QueryDocumentsResponse + +func (x *QueryDocumentsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryDocumentsResponse)(x) +} + +func (x *QueryDocumentsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_query_proto_msgTypes[9] + 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_QueryDocumentsResponse_messageType fastReflection_QueryDocumentsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryDocumentsResponse_messageType{} + +type fastReflection_QueryDocumentsResponse_messageType struct{} + +func (x fastReflection_QueryDocumentsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryDocumentsResponse)(nil) +} +func (x fastReflection_QueryDocumentsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryDocumentsResponse) +} +func (x fastReflection_QueryDocumentsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDocumentsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryDocumentsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryDocumentsResponse +} + +// 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_QueryDocumentsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryDocumentsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryDocumentsResponse) New() protoreflect.Message { + return new(fastReflection_QueryDocumentsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryDocumentsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryDocumentsResponse)(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_QueryDocumentsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Documents) != 0 { + value := protoreflect.ValueOfList(&_QueryDocumentsResponse_1_list{list: &x.Documents}) + if !f(fd_QueryDocumentsResponse_documents, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryDocumentsResponse_pagination, 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_QueryDocumentsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.QueryDocumentsResponse.documents": + return len(x.Documents) != 0 + case "sourcehub.orbis.QueryDocumentsResponse.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryDocumentsResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryDocumentsResponse 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_QueryDocumentsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.QueryDocumentsResponse.documents": + x.Documents = nil + case "sourcehub.orbis.QueryDocumentsResponse.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryDocumentsResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryDocumentsResponse 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_QueryDocumentsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.QueryDocumentsResponse.documents": + if len(x.Documents) == 0 { + return protoreflect.ValueOfList(&_QueryDocumentsResponse_1_list{}) + } + listValue := &_QueryDocumentsResponse_1_list{list: &x.Documents} + return protoreflect.ValueOfList(listValue) + case "sourcehub.orbis.QueryDocumentsResponse.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryDocumentsResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryDocumentsResponse 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_QueryDocumentsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.QueryDocumentsResponse.documents": + lv := value.List() + clv := lv.(*_QueryDocumentsResponse_1_list) + x.Documents = *clv.list + case "sourcehub.orbis.QueryDocumentsResponse.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageResponse) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryDocumentsResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryDocumentsResponse 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_QueryDocumentsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryDocumentsResponse.documents": + if x.Documents == nil { + x.Documents = []*Document{} + } + value := &_QueryDocumentsResponse_1_list{list: &x.Documents} + return protoreflect.ValueOfList(value) + case "sourcehub.orbis.QueryDocumentsResponse.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageResponse) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryDocumentsResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryDocumentsResponse 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_QueryDocumentsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryDocumentsResponse.documents": + list := []*Document{} + return protoreflect.ValueOfList(&_QueryDocumentsResponse_1_list{list: &list}) + case "sourcehub.orbis.QueryDocumentsResponse.pagination": + m := new(v1beta1.PageResponse) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryDocumentsResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryDocumentsResponse 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_QueryDocumentsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.QueryDocumentsResponse", 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_QueryDocumentsResponse) 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_QueryDocumentsResponse) 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_QueryDocumentsResponse) 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_QueryDocumentsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryDocumentsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Documents) > 0 { + for _, e := range x.Documents { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryDocumentsResponse) + 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.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Documents) > 0 { + for iNdEx := len(x.Documents) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Documents[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryDocumentsResponse) + 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: QueryDocumentsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryDocumentsResponse: 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 Documents", 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.Documents = append(x.Documents, &Document{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Documents[len(x.Documents)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pagination == nil { + x.Pagination = &v1beta1.PageResponse{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryKeyDerivationRequest protoreflect.MessageDescriptor + fd_QueryKeyDerivationRequest_id protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_query_proto_init() + md_QueryKeyDerivationRequest = File_sourcehub_orbis_query_proto.Messages().ByName("QueryKeyDerivationRequest") + fd_QueryKeyDerivationRequest_id = md_QueryKeyDerivationRequest.Fields().ByName("id") +} + +var _ protoreflect.Message = (*fastReflection_QueryKeyDerivationRequest)(nil) + +type fastReflection_QueryKeyDerivationRequest QueryKeyDerivationRequest + +func (x *QueryKeyDerivationRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryKeyDerivationRequest)(x) +} + +func (x *QueryKeyDerivationRequest) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_query_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryKeyDerivationRequest_messageType fastReflection_QueryKeyDerivationRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryKeyDerivationRequest_messageType{} + +type fastReflection_QueryKeyDerivationRequest_messageType struct{} + +func (x fastReflection_QueryKeyDerivationRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryKeyDerivationRequest)(nil) +} +func (x fastReflection_QueryKeyDerivationRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryKeyDerivationRequest) +} +func (x fastReflection_QueryKeyDerivationRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryKeyDerivationRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryKeyDerivationRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryKeyDerivationRequest +} + +// 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_QueryKeyDerivationRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryKeyDerivationRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryKeyDerivationRequest) New() protoreflect.Message { + return new(fastReflection_QueryKeyDerivationRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryKeyDerivationRequest) Interface() protoreflect.ProtoMessage { + return (*QueryKeyDerivationRequest)(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_QueryKeyDerivationRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Id != "" { + value := protoreflect.ValueOfString(x.Id) + if !f(fd_QueryKeyDerivationRequest_id, 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_QueryKeyDerivationRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.QueryKeyDerivationRequest.id": + return x.Id != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryKeyDerivationRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryKeyDerivationRequest 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_QueryKeyDerivationRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.QueryKeyDerivationRequest.id": + x.Id = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryKeyDerivationRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryKeyDerivationRequest 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_QueryKeyDerivationRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.QueryKeyDerivationRequest.id": + value := x.Id + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryKeyDerivationRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryKeyDerivationRequest 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_QueryKeyDerivationRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.QueryKeyDerivationRequest.id": + x.Id = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryKeyDerivationRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryKeyDerivationRequest 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_QueryKeyDerivationRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryKeyDerivationRequest.id": + panic(fmt.Errorf("field id of message sourcehub.orbis.QueryKeyDerivationRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryKeyDerivationRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryKeyDerivationRequest 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_QueryKeyDerivationRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryKeyDerivationRequest.id": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryKeyDerivationRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryKeyDerivationRequest 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_QueryKeyDerivationRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.QueryKeyDerivationRequest", 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_QueryKeyDerivationRequest) 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_QueryKeyDerivationRequest) 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_QueryKeyDerivationRequest) 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_QueryKeyDerivationRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryKeyDerivationRequest) + 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.Id) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryKeyDerivationRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Id) > 0 { + i -= len(x.Id) + copy(dAtA[i:], x.Id) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) + 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().(*QueryKeyDerivationRequest) + 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: QueryKeyDerivationRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryKeyDerivationRequest: 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 Id", 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.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryKeyDerivationResponse protoreflect.MessageDescriptor + fd_QueryKeyDerivationResponse_key_derivation protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_query_proto_init() + md_QueryKeyDerivationResponse = File_sourcehub_orbis_query_proto.Messages().ByName("QueryKeyDerivationResponse") + fd_QueryKeyDerivationResponse_key_derivation = md_QueryKeyDerivationResponse.Fields().ByName("key_derivation") +} + +var _ protoreflect.Message = (*fastReflection_QueryKeyDerivationResponse)(nil) + +type fastReflection_QueryKeyDerivationResponse QueryKeyDerivationResponse + +func (x *QueryKeyDerivationResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryKeyDerivationResponse)(x) +} + +func (x *QueryKeyDerivationResponse) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_query_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryKeyDerivationResponse_messageType fastReflection_QueryKeyDerivationResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryKeyDerivationResponse_messageType{} + +type fastReflection_QueryKeyDerivationResponse_messageType struct{} + +func (x fastReflection_QueryKeyDerivationResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryKeyDerivationResponse)(nil) +} +func (x fastReflection_QueryKeyDerivationResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryKeyDerivationResponse) +} +func (x fastReflection_QueryKeyDerivationResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryKeyDerivationResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryKeyDerivationResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryKeyDerivationResponse +} + +// 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_QueryKeyDerivationResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryKeyDerivationResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryKeyDerivationResponse) New() protoreflect.Message { + return new(fastReflection_QueryKeyDerivationResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryKeyDerivationResponse) Interface() protoreflect.ProtoMessage { + return (*QueryKeyDerivationResponse)(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_QueryKeyDerivationResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.KeyDerivation != nil { + value := protoreflect.ValueOfMessage(x.KeyDerivation.ProtoReflect()) + if !f(fd_QueryKeyDerivationResponse_key_derivation, 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_QueryKeyDerivationResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.QueryKeyDerivationResponse.key_derivation": + return x.KeyDerivation != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryKeyDerivationResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryKeyDerivationResponse 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_QueryKeyDerivationResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.QueryKeyDerivationResponse.key_derivation": + x.KeyDerivation = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryKeyDerivationResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryKeyDerivationResponse 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_QueryKeyDerivationResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.QueryKeyDerivationResponse.key_derivation": + value := x.KeyDerivation + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryKeyDerivationResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryKeyDerivationResponse 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_QueryKeyDerivationResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.QueryKeyDerivationResponse.key_derivation": + x.KeyDerivation = value.Message().Interface().(*KeyDerivation) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryKeyDerivationResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryKeyDerivationResponse 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_QueryKeyDerivationResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryKeyDerivationResponse.key_derivation": + if x.KeyDerivation == nil { + x.KeyDerivation = new(KeyDerivation) + } + return protoreflect.ValueOfMessage(x.KeyDerivation.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryKeyDerivationResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryKeyDerivationResponse 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_QueryKeyDerivationResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryKeyDerivationResponse.key_derivation": + m := new(KeyDerivation) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryKeyDerivationResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryKeyDerivationResponse 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_QueryKeyDerivationResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.QueryKeyDerivationResponse", 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_QueryKeyDerivationResponse) 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_QueryKeyDerivationResponse) 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_QueryKeyDerivationResponse) 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_QueryKeyDerivationResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryKeyDerivationResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.KeyDerivation != nil { + l = options.Size(x.KeyDerivation) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryKeyDerivationResponse) + 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.KeyDerivation != nil { + encoded, err := options.Marshal(x.KeyDerivation) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryKeyDerivationResponse) + 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: QueryKeyDerivationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryKeyDerivationResponse: 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 KeyDerivation", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.KeyDerivation == nil { + x.KeyDerivation = &KeyDerivation{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.KeyDerivation); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryKeyDerivationsRequest protoreflect.MessageDescriptor + fd_QueryKeyDerivationsRequest_pagination protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_query_proto_init() + md_QueryKeyDerivationsRequest = File_sourcehub_orbis_query_proto.Messages().ByName("QueryKeyDerivationsRequest") + fd_QueryKeyDerivationsRequest_pagination = md_QueryKeyDerivationsRequest.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryKeyDerivationsRequest)(nil) + +type fastReflection_QueryKeyDerivationsRequest QueryKeyDerivationsRequest + +func (x *QueryKeyDerivationsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryKeyDerivationsRequest)(x) +} + +func (x *QueryKeyDerivationsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_query_proto_msgTypes[12] + 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_QueryKeyDerivationsRequest_messageType fastReflection_QueryKeyDerivationsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryKeyDerivationsRequest_messageType{} + +type fastReflection_QueryKeyDerivationsRequest_messageType struct{} + +func (x fastReflection_QueryKeyDerivationsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryKeyDerivationsRequest)(nil) +} +func (x fastReflection_QueryKeyDerivationsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryKeyDerivationsRequest) +} +func (x fastReflection_QueryKeyDerivationsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryKeyDerivationsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryKeyDerivationsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryKeyDerivationsRequest +} + +// 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_QueryKeyDerivationsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryKeyDerivationsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryKeyDerivationsRequest) New() protoreflect.Message { + return new(fastReflection_QueryKeyDerivationsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryKeyDerivationsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryKeyDerivationsRequest)(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_QueryKeyDerivationsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryKeyDerivationsRequest_pagination, 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_QueryKeyDerivationsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.QueryKeyDerivationsRequest.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryKeyDerivationsRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryKeyDerivationsRequest 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_QueryKeyDerivationsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.QueryKeyDerivationsRequest.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryKeyDerivationsRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryKeyDerivationsRequest 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_QueryKeyDerivationsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.QueryKeyDerivationsRequest.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryKeyDerivationsRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryKeyDerivationsRequest 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_QueryKeyDerivationsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.QueryKeyDerivationsRequest.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryKeyDerivationsRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryKeyDerivationsRequest 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_QueryKeyDerivationsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryKeyDerivationsRequest.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageRequest) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryKeyDerivationsRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryKeyDerivationsRequest 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_QueryKeyDerivationsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryKeyDerivationsRequest.pagination": + m := new(v1beta1.PageRequest) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryKeyDerivationsRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryKeyDerivationsRequest 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_QueryKeyDerivationsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.QueryKeyDerivationsRequest", 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_QueryKeyDerivationsRequest) 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_QueryKeyDerivationsRequest) 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_QueryKeyDerivationsRequest) 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_QueryKeyDerivationsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryKeyDerivationsRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryKeyDerivationsRequest) + 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.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryKeyDerivationsRequest) + 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: QueryKeyDerivationsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryKeyDerivationsRequest: 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 Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pagination == nil { + x.Pagination = &v1beta1.PageRequest{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_QueryKeyDerivationsResponse_1_list)(nil) + +type _QueryKeyDerivationsResponse_1_list struct { + list *[]*KeyDerivation +} + +func (x *_QueryKeyDerivationsResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryKeyDerivationsResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryKeyDerivationsResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*KeyDerivation) + (*x.list)[i] = concreteValue +} + +func (x *_QueryKeyDerivationsResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*KeyDerivation) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryKeyDerivationsResponse_1_list) AppendMutable() protoreflect.Value { + v := new(KeyDerivation) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryKeyDerivationsResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryKeyDerivationsResponse_1_list) NewElement() protoreflect.Value { + v := new(KeyDerivation) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryKeyDerivationsResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryKeyDerivationsResponse protoreflect.MessageDescriptor + fd_QueryKeyDerivationsResponse_key_derivations protoreflect.FieldDescriptor + fd_QueryKeyDerivationsResponse_pagination protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_query_proto_init() + md_QueryKeyDerivationsResponse = File_sourcehub_orbis_query_proto.Messages().ByName("QueryKeyDerivationsResponse") + fd_QueryKeyDerivationsResponse_key_derivations = md_QueryKeyDerivationsResponse.Fields().ByName("key_derivations") + fd_QueryKeyDerivationsResponse_pagination = md_QueryKeyDerivationsResponse.Fields().ByName("pagination") +} + +var _ protoreflect.Message = (*fastReflection_QueryKeyDerivationsResponse)(nil) + +type fastReflection_QueryKeyDerivationsResponse QueryKeyDerivationsResponse + +func (x *QueryKeyDerivationsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryKeyDerivationsResponse)(x) +} + +func (x *QueryKeyDerivationsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_query_proto_msgTypes[13] + 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_QueryKeyDerivationsResponse_messageType fastReflection_QueryKeyDerivationsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryKeyDerivationsResponse_messageType{} + +type fastReflection_QueryKeyDerivationsResponse_messageType struct{} + +func (x fastReflection_QueryKeyDerivationsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryKeyDerivationsResponse)(nil) +} +func (x fastReflection_QueryKeyDerivationsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryKeyDerivationsResponse) +} +func (x fastReflection_QueryKeyDerivationsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryKeyDerivationsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryKeyDerivationsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryKeyDerivationsResponse +} + +// 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_QueryKeyDerivationsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryKeyDerivationsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryKeyDerivationsResponse) New() protoreflect.Message { + return new(fastReflection_QueryKeyDerivationsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryKeyDerivationsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryKeyDerivationsResponse)(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_QueryKeyDerivationsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.KeyDerivations) != 0 { + value := protoreflect.ValueOfList(&_QueryKeyDerivationsResponse_1_list{list: &x.KeyDerivations}) + if !f(fd_QueryKeyDerivationsResponse_key_derivations, value) { + return + } + } + if x.Pagination != nil { + value := protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + if !f(fd_QueryKeyDerivationsResponse_pagination, 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_QueryKeyDerivationsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.QueryKeyDerivationsResponse.key_derivations": + return len(x.KeyDerivations) != 0 + case "sourcehub.orbis.QueryKeyDerivationsResponse.pagination": + return x.Pagination != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryKeyDerivationsResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryKeyDerivationsResponse 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_QueryKeyDerivationsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.QueryKeyDerivationsResponse.key_derivations": + x.KeyDerivations = nil + case "sourcehub.orbis.QueryKeyDerivationsResponse.pagination": + x.Pagination = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryKeyDerivationsResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryKeyDerivationsResponse 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_QueryKeyDerivationsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.QueryKeyDerivationsResponse.key_derivations": + if len(x.KeyDerivations) == 0 { + return protoreflect.ValueOfList(&_QueryKeyDerivationsResponse_1_list{}) + } + listValue := &_QueryKeyDerivationsResponse_1_list{list: &x.KeyDerivations} + return protoreflect.ValueOfList(listValue) + case "sourcehub.orbis.QueryKeyDerivationsResponse.pagination": + value := x.Pagination + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryKeyDerivationsResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryKeyDerivationsResponse 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_QueryKeyDerivationsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.QueryKeyDerivationsResponse.key_derivations": + lv := value.List() + clv := lv.(*_QueryKeyDerivationsResponse_1_list) + x.KeyDerivations = *clv.list + case "sourcehub.orbis.QueryKeyDerivationsResponse.pagination": + x.Pagination = value.Message().Interface().(*v1beta1.PageResponse) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryKeyDerivationsResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryKeyDerivationsResponse 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_QueryKeyDerivationsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryKeyDerivationsResponse.key_derivations": + if x.KeyDerivations == nil { + x.KeyDerivations = []*KeyDerivation{} + } + value := &_QueryKeyDerivationsResponse_1_list{list: &x.KeyDerivations} + return protoreflect.ValueOfList(value) + case "sourcehub.orbis.QueryKeyDerivationsResponse.pagination": + if x.Pagination == nil { + x.Pagination = new(v1beta1.PageResponse) + } + return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryKeyDerivationsResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryKeyDerivationsResponse 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_QueryKeyDerivationsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryKeyDerivationsResponse.key_derivations": + list := []*KeyDerivation{} + return protoreflect.ValueOfList(&_QueryKeyDerivationsResponse_1_list{list: &list}) + case "sourcehub.orbis.QueryKeyDerivationsResponse.pagination": + m := new(v1beta1.PageResponse) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryKeyDerivationsResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryKeyDerivationsResponse 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_QueryKeyDerivationsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.QueryKeyDerivationsResponse", 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_QueryKeyDerivationsResponse) 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_QueryKeyDerivationsResponse) 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_QueryKeyDerivationsResponse) 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_QueryKeyDerivationsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryKeyDerivationsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.KeyDerivations) > 0 { + for _, e := range x.KeyDerivations { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.Pagination != nil { + l = options.Size(x.Pagination) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryKeyDerivationsResponse) + 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.Pagination != nil { + encoded, err := options.Marshal(x.Pagination) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.KeyDerivations) > 0 { + for iNdEx := len(x.KeyDerivations) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.KeyDerivations[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryKeyDerivationsResponse) + 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: QueryKeyDerivationsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryKeyDerivationsResponse: 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 KeyDerivations", 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.KeyDerivations = append(x.KeyDerivations, &KeyDerivation{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.KeyDerivations[len(x.KeyDerivations)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Pagination == nil { + x.Pagination = &v1beta1.PageResponse{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Pagination); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryNodeInfoRequest protoreflect.MessageDescriptor + fd_QueryNodeInfoRequest_node_key protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_query_proto_init() + md_QueryNodeInfoRequest = File_sourcehub_orbis_query_proto.Messages().ByName("QueryNodeInfoRequest") + fd_QueryNodeInfoRequest_node_key = md_QueryNodeInfoRequest.Fields().ByName("node_key") +} + +var _ protoreflect.Message = (*fastReflection_QueryNodeInfoRequest)(nil) + +type fastReflection_QueryNodeInfoRequest QueryNodeInfoRequest + +func (x *QueryNodeInfoRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryNodeInfoRequest)(x) +} + +func (x *QueryNodeInfoRequest) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_query_proto_msgTypes[14] + 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_QueryNodeInfoRequest_messageType fastReflection_QueryNodeInfoRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryNodeInfoRequest_messageType{} + +type fastReflection_QueryNodeInfoRequest_messageType struct{} + +func (x fastReflection_QueryNodeInfoRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryNodeInfoRequest)(nil) +} +func (x fastReflection_QueryNodeInfoRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryNodeInfoRequest) +} +func (x fastReflection_QueryNodeInfoRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryNodeInfoRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryNodeInfoRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryNodeInfoRequest +} + +// 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_QueryNodeInfoRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryNodeInfoRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryNodeInfoRequest) New() protoreflect.Message { + return new(fastReflection_QueryNodeInfoRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryNodeInfoRequest) Interface() protoreflect.ProtoMessage { + return (*QueryNodeInfoRequest)(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_QueryNodeInfoRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.NodeKey != "" { + value := protoreflect.ValueOfString(x.NodeKey) + if !f(fd_QueryNodeInfoRequest_node_key, 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_QueryNodeInfoRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.QueryNodeInfoRequest.node_key": + return x.NodeKey != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryNodeInfoRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryNodeInfoRequest 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_QueryNodeInfoRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.QueryNodeInfoRequest.node_key": + x.NodeKey = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryNodeInfoRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryNodeInfoRequest 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_QueryNodeInfoRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.QueryNodeInfoRequest.node_key": + value := x.NodeKey + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryNodeInfoRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryNodeInfoRequest 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_QueryNodeInfoRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.QueryNodeInfoRequest.node_key": + x.NodeKey = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryNodeInfoRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryNodeInfoRequest 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_QueryNodeInfoRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryNodeInfoRequest.node_key": + panic(fmt.Errorf("field node_key of message sourcehub.orbis.QueryNodeInfoRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryNodeInfoRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryNodeInfoRequest 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_QueryNodeInfoRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryNodeInfoRequest.node_key": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryNodeInfoRequest")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryNodeInfoRequest 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_QueryNodeInfoRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.QueryNodeInfoRequest", 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_QueryNodeInfoRequest) 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_QueryNodeInfoRequest) 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_QueryNodeInfoRequest) 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_QueryNodeInfoRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryNodeInfoRequest) + 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.NodeKey) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryNodeInfoRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.NodeKey) > 0 { + i -= len(x.NodeKey) + copy(dAtA[i:], x.NodeKey) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.NodeKey))) + 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().(*QueryNodeInfoRequest) + 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: QueryNodeInfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryNodeInfoRequest: 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 NodeKey", 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.NodeKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryNodeInfoResponse protoreflect.MessageDescriptor + fd_QueryNodeInfoResponse_node_info protoreflect.FieldDescriptor +) + +func init() { + file_sourcehub_orbis_query_proto_init() + md_QueryNodeInfoResponse = File_sourcehub_orbis_query_proto.Messages().ByName("QueryNodeInfoResponse") + fd_QueryNodeInfoResponse_node_info = md_QueryNodeInfoResponse.Fields().ByName("node_info") +} + +var _ protoreflect.Message = (*fastReflection_QueryNodeInfoResponse)(nil) + +type fastReflection_QueryNodeInfoResponse QueryNodeInfoResponse + +func (x *QueryNodeInfoResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryNodeInfoResponse)(x) +} + +func (x *QueryNodeInfoResponse) slowProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_query_proto_msgTypes[15] + 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_QueryNodeInfoResponse_messageType fastReflection_QueryNodeInfoResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryNodeInfoResponse_messageType{} + +type fastReflection_QueryNodeInfoResponse_messageType struct{} + +func (x fastReflection_QueryNodeInfoResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryNodeInfoResponse)(nil) +} +func (x fastReflection_QueryNodeInfoResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryNodeInfoResponse) +} +func (x fastReflection_QueryNodeInfoResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryNodeInfoResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryNodeInfoResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryNodeInfoResponse +} + +// 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_QueryNodeInfoResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryNodeInfoResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryNodeInfoResponse) New() protoreflect.Message { + return new(fastReflection_QueryNodeInfoResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryNodeInfoResponse) Interface() protoreflect.ProtoMessage { + return (*QueryNodeInfoResponse)(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_QueryNodeInfoResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.NodeInfo != nil { + value := protoreflect.ValueOfMessage(x.NodeInfo.ProtoReflect()) + if !f(fd_QueryNodeInfoResponse_node_info, 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_QueryNodeInfoResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "sourcehub.orbis.QueryNodeInfoResponse.node_info": + return x.NodeInfo != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryNodeInfoResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryNodeInfoResponse 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_QueryNodeInfoResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "sourcehub.orbis.QueryNodeInfoResponse.node_info": + x.NodeInfo = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryNodeInfoResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryNodeInfoResponse 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_QueryNodeInfoResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "sourcehub.orbis.QueryNodeInfoResponse.node_info": + value := x.NodeInfo + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryNodeInfoResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryNodeInfoResponse 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_QueryNodeInfoResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "sourcehub.orbis.QueryNodeInfoResponse.node_info": + x.NodeInfo = value.Message().Interface().(*NodeInfo) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryNodeInfoResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryNodeInfoResponse 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_QueryNodeInfoResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryNodeInfoResponse.node_info": + if x.NodeInfo == nil { + x.NodeInfo = new(NodeInfo) + } + return protoreflect.ValueOfMessage(x.NodeInfo.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryNodeInfoResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryNodeInfoResponse 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_QueryNodeInfoResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "sourcehub.orbis.QueryNodeInfoResponse.node_info": + m := new(NodeInfo) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: sourcehub.orbis.QueryNodeInfoResponse")) + } + panic(fmt.Errorf("message sourcehub.orbis.QueryNodeInfoResponse 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_QueryNodeInfoResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in sourcehub.orbis.QueryNodeInfoResponse", 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_QueryNodeInfoResponse) 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_QueryNodeInfoResponse) 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_QueryNodeInfoResponse) 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_QueryNodeInfoResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryNodeInfoResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.NodeInfo != nil { + l = options.Size(x.NodeInfo) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryNodeInfoResponse) + 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.NodeInfo != nil { + encoded, err := options.Marshal(x.NodeInfo) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryNodeInfoResponse) + 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: QueryNodeInfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryNodeInfoResponse: 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 NodeInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.NodeInfo == nil { + x.NodeInfo = &NodeInfo{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.NodeInfo); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: sourcehub/orbis/query.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryParamsRequest) Reset() { + *x = QueryParamsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsRequest) ProtoMessage() {} + +// Deprecated: Use QueryParamsRequest.ProtoReflect.Descriptor instead. +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_query_proto_rawDescGZIP(), []int{0} +} + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (x *QueryParamsResponse) Reset() { + *x = QueryParamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryParamsResponse) ProtoMessage() {} + +// Deprecated: Use QueryParamsResponse.ProtoReflect.Descriptor instead. +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_query_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryParamsResponse) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +type QueryRingRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *QueryRingRequest) Reset() { + *x = QueryRingRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryRingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryRingRequest) ProtoMessage() {} + +// Deprecated: Use QueryRingRequest.ProtoReflect.Descriptor instead. +func (*QueryRingRequest) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_query_proto_rawDescGZIP(), []int{2} +} + +func (x *QueryRingRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type QueryRingResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ring *Ring `protobuf:"bytes,1,opt,name=ring,proto3" json:"ring,omitempty"` +} + +func (x *QueryRingResponse) Reset() { + *x = QueryRingResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryRingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryRingResponse) ProtoMessage() {} + +// Deprecated: Use QueryRingResponse.ProtoReflect.Descriptor instead. +func (*QueryRingResponse) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_query_proto_rawDescGZIP(), []int{3} +} + +func (x *QueryRingResponse) GetRing() *Ring { + if x != nil { + return x.Ring + } + return nil +} + +type QueryRingsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pagination *v1beta1.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryRingsRequest) Reset() { + *x = QueryRingsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_query_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryRingsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryRingsRequest) ProtoMessage() {} + +// Deprecated: Use QueryRingsRequest.ProtoReflect.Descriptor instead. +func (*QueryRingsRequest) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_query_proto_rawDescGZIP(), []int{4} +} + +func (x *QueryRingsRequest) GetPagination() *v1beta1.PageRequest { + if x != nil { + return x.Pagination + } + return nil +} + +type QueryRingsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Rings []*Ring `protobuf:"bytes,1,rep,name=rings,proto3" json:"rings,omitempty"` + Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryRingsResponse) Reset() { + *x = QueryRingsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_query_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryRingsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryRingsResponse) ProtoMessage() {} + +// Deprecated: Use QueryRingsResponse.ProtoReflect.Descriptor instead. +func (*QueryRingsResponse) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_query_proto_rawDescGZIP(), []int{5} +} + +func (x *QueryRingsResponse) GetRings() []*Ring { + if x != nil { + return x.Rings + } + return nil +} + +func (x *QueryRingsResponse) GetPagination() *v1beta1.PageResponse { + if x != nil { + return x.Pagination + } + return nil +} + +type QueryDocumentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *QueryDocumentRequest) Reset() { + *x = QueryDocumentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_query_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryDocumentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryDocumentRequest) ProtoMessage() {} + +// Deprecated: Use QueryDocumentRequest.ProtoReflect.Descriptor instead. +func (*QueryDocumentRequest) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_query_proto_rawDescGZIP(), []int{6} +} + +func (x *QueryDocumentRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type QueryDocumentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Document *Document `protobuf:"bytes,1,opt,name=document,proto3" json:"document,omitempty"` +} + +func (x *QueryDocumentResponse) Reset() { + *x = QueryDocumentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_query_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryDocumentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryDocumentResponse) ProtoMessage() {} + +// Deprecated: Use QueryDocumentResponse.ProtoReflect.Descriptor instead. +func (*QueryDocumentResponse) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_query_proto_rawDescGZIP(), []int{7} +} + +func (x *QueryDocumentResponse) GetDocument() *Document { + if x != nil { + return x.Document + } + return nil +} + +type QueryDocumentsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pagination *v1beta1.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryDocumentsRequest) Reset() { + *x = QueryDocumentsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_query_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryDocumentsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryDocumentsRequest) ProtoMessage() {} + +// Deprecated: Use QueryDocumentsRequest.ProtoReflect.Descriptor instead. +func (*QueryDocumentsRequest) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_query_proto_rawDescGZIP(), []int{8} +} + +func (x *QueryDocumentsRequest) GetPagination() *v1beta1.PageRequest { + if x != nil { + return x.Pagination + } + return nil +} + +type QueryDocumentsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Documents []*Document `protobuf:"bytes,1,rep,name=documents,proto3" json:"documents,omitempty"` + Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryDocumentsResponse) Reset() { + *x = QueryDocumentsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_query_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryDocumentsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryDocumentsResponse) ProtoMessage() {} + +// Deprecated: Use QueryDocumentsResponse.ProtoReflect.Descriptor instead. +func (*QueryDocumentsResponse) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_query_proto_rawDescGZIP(), []int{9} +} + +func (x *QueryDocumentsResponse) GetDocuments() []*Document { + if x != nil { + return x.Documents + } + return nil +} + +func (x *QueryDocumentsResponse) GetPagination() *v1beta1.PageResponse { + if x != nil { + return x.Pagination + } + return nil +} + +type QueryKeyDerivationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *QueryKeyDerivationRequest) Reset() { + *x = QueryKeyDerivationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_query_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryKeyDerivationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryKeyDerivationRequest) ProtoMessage() {} + +// Deprecated: Use QueryKeyDerivationRequest.ProtoReflect.Descriptor instead. +func (*QueryKeyDerivationRequest) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_query_proto_rawDescGZIP(), []int{10} +} + +func (x *QueryKeyDerivationRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type QueryKeyDerivationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + KeyDerivation *KeyDerivation `protobuf:"bytes,1,opt,name=key_derivation,json=keyDerivation,proto3" json:"key_derivation,omitempty"` +} + +func (x *QueryKeyDerivationResponse) Reset() { + *x = QueryKeyDerivationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_query_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryKeyDerivationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryKeyDerivationResponse) ProtoMessage() {} + +// Deprecated: Use QueryKeyDerivationResponse.ProtoReflect.Descriptor instead. +func (*QueryKeyDerivationResponse) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_query_proto_rawDescGZIP(), []int{11} +} + +func (x *QueryKeyDerivationResponse) GetKeyDerivation() *KeyDerivation { + if x != nil { + return x.KeyDerivation + } + return nil +} + +type QueryKeyDerivationsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pagination *v1beta1.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryKeyDerivationsRequest) Reset() { + *x = QueryKeyDerivationsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_query_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryKeyDerivationsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryKeyDerivationsRequest) ProtoMessage() {} + +// Deprecated: Use QueryKeyDerivationsRequest.ProtoReflect.Descriptor instead. +func (*QueryKeyDerivationsRequest) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_query_proto_rawDescGZIP(), []int{12} +} + +func (x *QueryKeyDerivationsRequest) GetPagination() *v1beta1.PageRequest { + if x != nil { + return x.Pagination + } + return nil +} + +type QueryKeyDerivationsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + KeyDerivations []*KeyDerivation `protobuf:"bytes,1,rep,name=key_derivations,json=keyDerivations,proto3" json:"key_derivations,omitempty"` + Pagination *v1beta1.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *QueryKeyDerivationsResponse) Reset() { + *x = QueryKeyDerivationsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_query_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryKeyDerivationsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryKeyDerivationsResponse) ProtoMessage() {} + +// Deprecated: Use QueryKeyDerivationsResponse.ProtoReflect.Descriptor instead. +func (*QueryKeyDerivationsResponse) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_query_proto_rawDescGZIP(), []int{13} +} + +func (x *QueryKeyDerivationsResponse) GetKeyDerivations() []*KeyDerivation { + if x != nil { + return x.KeyDerivations + } + return nil +} + +func (x *QueryKeyDerivationsResponse) GetPagination() *v1beta1.PageResponse { + if x != nil { + return x.Pagination + } + return nil +} + +type QueryNodeInfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` +} + +func (x *QueryNodeInfoRequest) Reset() { + *x = QueryNodeInfoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_query_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryNodeInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryNodeInfoRequest) ProtoMessage() {} + +// Deprecated: Use QueryNodeInfoRequest.ProtoReflect.Descriptor instead. +func (*QueryNodeInfoRequest) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_query_proto_rawDescGZIP(), []int{14} +} + +func (x *QueryNodeInfoRequest) GetNodeKey() string { + if x != nil { + return x.NodeKey + } + return "" +} + +type QueryNodeInfoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeInfo *NodeInfo `protobuf:"bytes,1,opt,name=node_info,json=nodeInfo,proto3" json:"node_info,omitempty"` +} + +func (x *QueryNodeInfoResponse) Reset() { + *x = QueryNodeInfoResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_sourcehub_orbis_query_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryNodeInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryNodeInfoResponse) ProtoMessage() {} + +// Deprecated: Use QueryNodeInfoResponse.ProtoReflect.Descriptor instead. +func (*QueryNodeInfoResponse) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_query_proto_rawDescGZIP(), []int{15} +} + +func (x *QueryNodeInfoResponse) GetNodeInfo() *NodeInfo { + if x != nil { + return x.NodeInfo + } + return nil +} + +var File_sourcehub_orbis_query_proto protoreflect.FileDescriptor + +var file_sourcehub_orbis_query_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x6f, 0x72, 0x62, 0x69, + 0x73, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x1a, 0x11, + 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x67, + 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, + 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x1e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x6f, 0x72, 0x62, + 0x69, 0x73, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x24, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x6f, 0x72, 0x62, + 0x69, 0x73, 0x2f, 0x6b, 0x65, 0x79, 0x5f, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, + 0x75, 0x62, 0x2f, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, + 0x66, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x68, 0x75, 0x62, 0x2f, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, + 0x62, 0x2f, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2f, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x14, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x51, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x3a, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, + 0x73, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, + 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x22, 0x0a, 0x10, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, + 0x3e, 0x0a, 0x11, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x04, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, + 0x72, 0x62, 0x69, 0x73, 0x2e, 0x52, 0x69, 0x6e, 0x67, 0x52, 0x04, 0x72, 0x69, 0x6e, 0x67, 0x22, + 0x5b, 0x0a, 0x11, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x95, 0x01, 0x0a, + 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x05, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, + 0x72, 0x62, 0x69, 0x73, 0x2e, 0x52, 0x69, 0x6e, 0x67, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, + 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x05, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, + 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x26, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x6f, 0x63, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x4e, 0x0a, 0x15, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x08, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x5f, 0x0a, 0x15, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xa5, 0x01, + 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x09, 0x64, 0x6f, 0x63, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2e, 0x44, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, + 0x01, 0x52, 0x09, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x47, 0x0a, 0x0a, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2b, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4b, 0x65, + 0x79, 0x44, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x22, 0x63, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4b, 0x65, 0x79, 0x44, 0x65, + 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x45, 0x0a, 0x0e, 0x6b, 0x65, 0x79, 0x5f, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2e, 0x4b, 0x65, 0x79, 0x44, 0x65, + 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6b, 0x65, 0x79, 0x44, 0x65, 0x72, + 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x64, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x4b, 0x65, 0x79, 0x44, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xba, 0x01, + 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4b, 0x65, 0x79, 0x44, 0x65, 0x72, 0x69, 0x76, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, + 0x0f, 0x6b, 0x65, 0x79, 0x5f, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, + 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2e, 0x4b, 0x65, 0x79, 0x44, 0x65, 0x72, 0x69, + 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, + 0x01, 0x52, 0x0e, 0x6b, 0x65, 0x79, 0x44, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, + 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x31, 0x0a, 0x14, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x22, 0x4f, 0x0a, + 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, + 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2e, 0x4e, 0x6f, 0x64, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x32, 0x96, + 0x09, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x82, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x12, 0x23, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, + 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, + 0x2f, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x7f, 0x0a, + 0x04, 0x52, 0x69, 0x6e, 0x67, 0x12, 0x21, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, + 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x69, 0x6e, + 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x52, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x6f, + 0x72, 0x62, 0x69, 0x73, 0x2f, 0x72, 0x69, 0x6e, 0x67, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x7e, + 0x0a, 0x05, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x22, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, + 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x52, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, + 0x75, 0x62, 0x2f, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2f, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x8f, + 0x01, 0x0a, 0x08, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x2e, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, + 0x72, 0x62, 0x69, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x6f, 0x72, 0x62, + 0x69, 0x73, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, + 0x12, 0x8e, 0x01, 0x0a, 0x09, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x26, + 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, + 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, + 0x62, 0x2f, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x12, 0xa4, 0x01, 0x0a, 0x0d, 0x4b, 0x65, 0x79, 0x44, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, + 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4b, 0x65, 0x79, 0x44, 0x65, + 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2b, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, + 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4b, 0x65, 0x79, 0x44, 0x65, 0x72, 0x69, 0x76, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x34, 0x12, 0x32, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x6f, + 0x72, 0x62, 0x69, 0x73, 0x2f, 0x6b, 0x65, 0x79, 0x5f, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0xa3, 0x01, 0x0a, 0x0e, 0x4b, 0x65, 0x79, + 0x44, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2b, 0x2e, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x4b, 0x65, 0x79, 0x44, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x4b, 0x65, 0x79, 0x44, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x12, 0x2e, + 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2f, 0x6b, + 0x65, 0x79, 0x5f, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x96, + 0x01, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x25, 0x2e, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, + 0x72, 0x62, 0x69, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x35, 0x12, 0x33, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x6f, 0x72, 0x62, + 0x69, 0x73, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x7b, 0x6e, 0x6f, + 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x7d, 0x42, 0xa0, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2e, 0x6f, 0x72, 0x62, 0x69, 0x73, 0x42, + 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, 0x62, 0x2f, 0x6f, 0x72, 0x62, 0x69, 0x73, 0xa2, + 0x02, 0x03, 0x53, 0x4f, 0x58, 0xaa, 0x02, 0x0f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x68, 0x75, + 0x62, 0x2e, 0x4f, 0x72, 0x62, 0x69, 0x73, 0xca, 0x02, 0x0f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x68, 0x75, 0x62, 0x5c, 0x4f, 0x72, 0x62, 0x69, 0x73, 0xe2, 0x02, 0x1b, 0x53, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x68, 0x75, 0x62, 0x5c, 0x4f, 0x72, 0x62, 0x69, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x68, 0x75, 0x62, 0x3a, 0x3a, 0x4f, 0x72, 0x62, 0x69, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_sourcehub_orbis_query_proto_rawDescOnce sync.Once + file_sourcehub_orbis_query_proto_rawDescData = file_sourcehub_orbis_query_proto_rawDesc +) + +func file_sourcehub_orbis_query_proto_rawDescGZIP() []byte { + file_sourcehub_orbis_query_proto_rawDescOnce.Do(func() { + file_sourcehub_orbis_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_sourcehub_orbis_query_proto_rawDescData) + }) + return file_sourcehub_orbis_query_proto_rawDescData +} + +var file_sourcehub_orbis_query_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_sourcehub_orbis_query_proto_goTypes = []interface{}{ + (*QueryParamsRequest)(nil), // 0: sourcehub.orbis.QueryParamsRequest + (*QueryParamsResponse)(nil), // 1: sourcehub.orbis.QueryParamsResponse + (*QueryRingRequest)(nil), // 2: sourcehub.orbis.QueryRingRequest + (*QueryRingResponse)(nil), // 3: sourcehub.orbis.QueryRingResponse + (*QueryRingsRequest)(nil), // 4: sourcehub.orbis.QueryRingsRequest + (*QueryRingsResponse)(nil), // 5: sourcehub.orbis.QueryRingsResponse + (*QueryDocumentRequest)(nil), // 6: sourcehub.orbis.QueryDocumentRequest + (*QueryDocumentResponse)(nil), // 7: sourcehub.orbis.QueryDocumentResponse + (*QueryDocumentsRequest)(nil), // 8: sourcehub.orbis.QueryDocumentsRequest + (*QueryDocumentsResponse)(nil), // 9: sourcehub.orbis.QueryDocumentsResponse + (*QueryKeyDerivationRequest)(nil), // 10: sourcehub.orbis.QueryKeyDerivationRequest + (*QueryKeyDerivationResponse)(nil), // 11: sourcehub.orbis.QueryKeyDerivationResponse + (*QueryKeyDerivationsRequest)(nil), // 12: sourcehub.orbis.QueryKeyDerivationsRequest + (*QueryKeyDerivationsResponse)(nil), // 13: sourcehub.orbis.QueryKeyDerivationsResponse + (*QueryNodeInfoRequest)(nil), // 14: sourcehub.orbis.QueryNodeInfoRequest + (*QueryNodeInfoResponse)(nil), // 15: sourcehub.orbis.QueryNodeInfoResponse + (*Params)(nil), // 16: sourcehub.orbis.Params + (*Ring)(nil), // 17: sourcehub.orbis.Ring + (*v1beta1.PageRequest)(nil), // 18: cosmos.base.query.v1beta1.PageRequest + (*v1beta1.PageResponse)(nil), // 19: cosmos.base.query.v1beta1.PageResponse + (*Document)(nil), // 20: sourcehub.orbis.Document + (*KeyDerivation)(nil), // 21: sourcehub.orbis.KeyDerivation + (*NodeInfo)(nil), // 22: sourcehub.orbis.NodeInfo +} +var file_sourcehub_orbis_query_proto_depIdxs = []int32{ + 16, // 0: sourcehub.orbis.QueryParamsResponse.params:type_name -> sourcehub.orbis.Params + 17, // 1: sourcehub.orbis.QueryRingResponse.ring:type_name -> sourcehub.orbis.Ring + 18, // 2: sourcehub.orbis.QueryRingsRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 17, // 3: sourcehub.orbis.QueryRingsResponse.rings:type_name -> sourcehub.orbis.Ring + 19, // 4: sourcehub.orbis.QueryRingsResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 20, // 5: sourcehub.orbis.QueryDocumentResponse.document:type_name -> sourcehub.orbis.Document + 18, // 6: sourcehub.orbis.QueryDocumentsRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 20, // 7: sourcehub.orbis.QueryDocumentsResponse.documents:type_name -> sourcehub.orbis.Document + 19, // 8: sourcehub.orbis.QueryDocumentsResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 21, // 9: sourcehub.orbis.QueryKeyDerivationResponse.key_derivation:type_name -> sourcehub.orbis.KeyDerivation + 18, // 10: sourcehub.orbis.QueryKeyDerivationsRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 21, // 11: sourcehub.orbis.QueryKeyDerivationsResponse.key_derivations:type_name -> sourcehub.orbis.KeyDerivation + 19, // 12: sourcehub.orbis.QueryKeyDerivationsResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 22, // 13: sourcehub.orbis.QueryNodeInfoResponse.node_info:type_name -> sourcehub.orbis.NodeInfo + 0, // 14: sourcehub.orbis.Query.Params:input_type -> sourcehub.orbis.QueryParamsRequest + 2, // 15: sourcehub.orbis.Query.Ring:input_type -> sourcehub.orbis.QueryRingRequest + 4, // 16: sourcehub.orbis.Query.Rings:input_type -> sourcehub.orbis.QueryRingsRequest + 6, // 17: sourcehub.orbis.Query.Document:input_type -> sourcehub.orbis.QueryDocumentRequest + 8, // 18: sourcehub.orbis.Query.Documents:input_type -> sourcehub.orbis.QueryDocumentsRequest + 10, // 19: sourcehub.orbis.Query.KeyDerivation:input_type -> sourcehub.orbis.QueryKeyDerivationRequest + 12, // 20: sourcehub.orbis.Query.KeyDerivations:input_type -> sourcehub.orbis.QueryKeyDerivationsRequest + 14, // 21: sourcehub.orbis.Query.NodeInfo:input_type -> sourcehub.orbis.QueryNodeInfoRequest + 1, // 22: sourcehub.orbis.Query.Params:output_type -> sourcehub.orbis.QueryParamsResponse + 3, // 23: sourcehub.orbis.Query.Ring:output_type -> sourcehub.orbis.QueryRingResponse + 5, // 24: sourcehub.orbis.Query.Rings:output_type -> sourcehub.orbis.QueryRingsResponse + 7, // 25: sourcehub.orbis.Query.Document:output_type -> sourcehub.orbis.QueryDocumentResponse + 9, // 26: sourcehub.orbis.Query.Documents:output_type -> sourcehub.orbis.QueryDocumentsResponse + 11, // 27: sourcehub.orbis.Query.KeyDerivation:output_type -> sourcehub.orbis.QueryKeyDerivationResponse + 13, // 28: sourcehub.orbis.Query.KeyDerivations:output_type -> sourcehub.orbis.QueryKeyDerivationsResponse + 15, // 29: sourcehub.orbis.Query.NodeInfo:output_type -> sourcehub.orbis.QueryNodeInfoResponse + 22, // [22:30] is the sub-list for method output_type + 14, // [14:22] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name +} + +func init() { file_sourcehub_orbis_query_proto_init() } +func file_sourcehub_orbis_query_proto_init() { + if File_sourcehub_orbis_query_proto != nil { + return + } + file_sourcehub_orbis_document_proto_init() + file_sourcehub_orbis_key_derivation_proto_init() + file_sourcehub_orbis_node_info_proto_init() + file_sourcehub_orbis_params_proto_init() + file_sourcehub_orbis_ring_proto_init() + if !protoimpl.UnsafeEnabled { + file_sourcehub_orbis_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sourcehub_orbis_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryParamsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sourcehub_orbis_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryRingRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sourcehub_orbis_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryRingResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sourcehub_orbis_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryRingsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sourcehub_orbis_query_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryRingsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sourcehub_orbis_query_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryDocumentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sourcehub_orbis_query_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryDocumentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sourcehub_orbis_query_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryDocumentsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sourcehub_orbis_query_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryDocumentsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sourcehub_orbis_query_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryKeyDerivationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sourcehub_orbis_query_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryKeyDerivationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sourcehub_orbis_query_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryKeyDerivationsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sourcehub_orbis_query_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryKeyDerivationsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sourcehub_orbis_query_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryNodeInfoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_sourcehub_orbis_query_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryNodeInfoResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_sourcehub_orbis_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 16, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_sourcehub_orbis_query_proto_goTypes, + DependencyIndexes: file_sourcehub_orbis_query_proto_depIdxs, + MessageInfos: file_sourcehub_orbis_query_proto_msgTypes, + }.Build() + File_sourcehub_orbis_query_proto = out.File + file_sourcehub_orbis_query_proto_rawDesc = nil + file_sourcehub_orbis_query_proto_goTypes = nil + file_sourcehub_orbis_query_proto_depIdxs = nil +} diff --git a/api/sourcehub/orbis/query_grpc.pb.go b/api/sourcehub/orbis/query_grpc.pb.go new file mode 100644 index 00000000..a5dc9e5e --- /dev/null +++ b/api/sourcehub/orbis/query_grpc.pb.go @@ -0,0 +1,407 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc (unknown) +// source: sourcehub/orbis/query.proto + +package orbis + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Query_Params_FullMethodName = "/sourcehub.orbis.Query/Params" + Query_Ring_FullMethodName = "/sourcehub.orbis.Query/Ring" + Query_Rings_FullMethodName = "/sourcehub.orbis.Query/Rings" + Query_Document_FullMethodName = "/sourcehub.orbis.Query/Document" + Query_Documents_FullMethodName = "/sourcehub.orbis.Query/Documents" + Query_KeyDerivation_FullMethodName = "/sourcehub.orbis.Query/KeyDerivation" + Query_KeyDerivations_FullMethodName = "/sourcehub.orbis.Query/KeyDerivations" + Query_NodeInfo_FullMethodName = "/sourcehub.orbis.Query/NodeInfo" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Query defines the gRPC querier service. +type QueryClient interface { + // Parameters queries the parameters of the module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // Ring queries a ring by id. + Ring(ctx context.Context, in *QueryRingRequest, opts ...grpc.CallOption) (*QueryRingResponse, error) + // Rings queries rings. + Rings(ctx context.Context, in *QueryRingsRequest, opts ...grpc.CallOption) (*QueryRingsResponse, error) + // Document queries an encrypted document by id. + Document(ctx context.Context, in *QueryDocumentRequest, opts ...grpc.CallOption) (*QueryDocumentResponse, error) + // Documents queries encrypted documents. + Documents(ctx context.Context, in *QueryDocumentsRequest, opts ...grpc.CallOption) (*QueryDocumentsResponse, error) + // KeyDerivation queries a key derivation by id. + KeyDerivation(ctx context.Context, in *QueryKeyDerivationRequest, opts ...grpc.CallOption) (*QueryKeyDerivationResponse, error) + // KeyDerivations queries key derivations. + KeyDerivations(ctx context.Context, in *QueryKeyDerivationsRequest, opts ...grpc.CallOption) (*QueryKeyDerivationsResponse, error) + // NodeInfo queries node info by node key. + NodeInfo(ctx context.Context, in *QueryNodeInfoRequest, opts ...grpc.CallOption) (*QueryNodeInfoResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Ring(ctx context.Context, in *QueryRingRequest, opts ...grpc.CallOption) (*QueryRingResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryRingResponse) + err := c.cc.Invoke(ctx, Query_Ring_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Rings(ctx context.Context, in *QueryRingsRequest, opts ...grpc.CallOption) (*QueryRingsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryRingsResponse) + err := c.cc.Invoke(ctx, Query_Rings_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Document(ctx context.Context, in *QueryDocumentRequest, opts ...grpc.CallOption) (*QueryDocumentResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryDocumentResponse) + err := c.cc.Invoke(ctx, Query_Document_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Documents(ctx context.Context, in *QueryDocumentsRequest, opts ...grpc.CallOption) (*QueryDocumentsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryDocumentsResponse) + err := c.cc.Invoke(ctx, Query_Documents_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) KeyDerivation(ctx context.Context, in *QueryKeyDerivationRequest, opts ...grpc.CallOption) (*QueryKeyDerivationResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryKeyDerivationResponse) + err := c.cc.Invoke(ctx, Query_KeyDerivation_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) KeyDerivations(ctx context.Context, in *QueryKeyDerivationsRequest, opts ...grpc.CallOption) (*QueryKeyDerivationsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryKeyDerivationsResponse) + err := c.cc.Invoke(ctx, Query_KeyDerivations_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) NodeInfo(ctx context.Context, in *QueryNodeInfoRequest, opts ...grpc.CallOption) (*QueryNodeInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryNodeInfoResponse) + err := c.cc.Invoke(ctx, Query_NodeInfo_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility. +// +// Query defines the gRPC querier service. +type QueryServer interface { + // Parameters queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Ring queries a ring by id. + Ring(context.Context, *QueryRingRequest) (*QueryRingResponse, error) + // Rings queries rings. + Rings(context.Context, *QueryRingsRequest) (*QueryRingsResponse, error) + // Document queries an encrypted document by id. + Document(context.Context, *QueryDocumentRequest) (*QueryDocumentResponse, error) + // Documents queries encrypted documents. + Documents(context.Context, *QueryDocumentsRequest) (*QueryDocumentsResponse, error) + // KeyDerivation queries a key derivation by id. + KeyDerivation(context.Context, *QueryKeyDerivationRequest) (*QueryKeyDerivationResponse, error) + // KeyDerivations queries key derivations. + KeyDerivations(context.Context, *QueryKeyDerivationsRequest) (*QueryKeyDerivationsResponse, error) + // NodeInfo queries node info by node key. + NodeInfo(context.Context, *QueryNodeInfoRequest) (*QueryNodeInfoResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} + +func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (UnimplementedQueryServer) Ring(context.Context, *QueryRingRequest) (*QueryRingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Ring not implemented") +} +func (UnimplementedQueryServer) Rings(context.Context, *QueryRingsRequest) (*QueryRingsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Rings not implemented") +} +func (UnimplementedQueryServer) Document(context.Context, *QueryDocumentRequest) (*QueryDocumentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Document not implemented") +} +func (UnimplementedQueryServer) Documents(context.Context, *QueryDocumentsRequest) (*QueryDocumentsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Documents not implemented") +} +func (UnimplementedQueryServer) KeyDerivation(context.Context, *QueryKeyDerivationRequest) (*QueryKeyDerivationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method KeyDerivation not implemented") +} +func (UnimplementedQueryServer) KeyDerivations(context.Context, *QueryKeyDerivationsRequest) (*QueryKeyDerivationsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method KeyDerivations not implemented") +} +func (UnimplementedQueryServer) NodeInfo(context.Context, *QueryNodeInfoRequest) (*QueryNodeInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NodeInfo not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Query_ServiceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Params_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Ring_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Ring(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Ring_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Ring(ctx, req.(*QueryRingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Rings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRingsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Rings(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Rings_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Rings(ctx, req.(*QueryRingsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Document_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDocumentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Document(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Document_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Document(ctx, req.(*QueryDocumentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Documents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDocumentsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Documents(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_Documents_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Documents(ctx, req.(*QueryDocumentsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_KeyDerivation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryKeyDerivationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).KeyDerivation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_KeyDerivation_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).KeyDerivation(ctx, req.(*QueryKeyDerivationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_KeyDerivations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryKeyDerivationsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).KeyDerivations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_KeyDerivations_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).KeyDerivations(ctx, req.(*QueryKeyDerivationsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_NodeInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryNodeInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).NodeInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_NodeInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).NodeInfo(ctx, req.(*QueryNodeInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "sourcehub.orbis.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Ring", + Handler: _Query_Ring_Handler, + }, + { + MethodName: "Rings", + Handler: _Query_Rings_Handler, + }, + { + MethodName: "Document", + Handler: _Query_Document_Handler, + }, + { + MethodName: "Documents", + Handler: _Query_Documents_Handler, + }, + { + MethodName: "KeyDerivation", + Handler: _Query_KeyDerivation_Handler, + }, + { + MethodName: "KeyDerivations", + Handler: _Query_KeyDerivations_Handler, + }, + { + MethodName: "NodeInfo", + Handler: _Query_NodeInfo_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "sourcehub/orbis/query.proto", +} diff --git a/api/sourcehub/orbis/ring.pb.go b/api/sourcehub/orbis/ring.pb.go new file mode 100644 index 00000000..1a224863 --- /dev/null +++ b/api/sourcehub/orbis/ring.pb.go @@ -0,0 +1,279 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc (unknown) +// source: sourcehub/orbis/ring.proto + +package orbis + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Ring stores the active and pending committee metadata for an Orbis ring. +type Ring struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + CreatorDid string `protobuf:"bytes,2,opt,name=creator_did,json=creatorDid,proto3" json:"creator_did,omitempty"` + RingPk string `protobuf:"bytes,3,opt,name=ring_pk,json=ringPk,proto3" json:"ring_pk,omitempty"` + PeerNodeKeys []string `protobuf:"bytes,4,rep,name=peer_node_keys,json=peerNodeKeys,proto3" json:"peer_node_keys,omitempty"` + Threshold uint32 `protobuf:"varint,5,opt,name=threshold,proto3" json:"threshold,omitempty"` + NewPeerNodeKeys []string `protobuf:"bytes,6,rep,name=new_peer_node_keys,json=newPeerNodeKeys,proto3" json:"new_peer_node_keys,omitempty"` + // Absent means no pending threshold update. + NewThreshold *uint32 `protobuf:"varint,7,opt,name=new_threshold,json=newThreshold,proto3,oneof" json:"new_threshold,omitempty"` + // Absent means automatic PSS refresh is disabled. + PssInterval *uint64 `protobuf:"varint,8,opt,name=pss_interval,json=pssInterval,proto3,oneof" json:"pss_interval,omitempty"` + BlockNumberNonce uint64 `protobuf:"varint,9,opt,name=block_number_nonce,json=blockNumberNonce,proto3" json:"block_number_nonce,omitempty"` + PolicyId string `protobuf:"bytes,10,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"` + Confirmations []*RingConfirmation `protobuf:"bytes,11,rep,name=confirmations,proto3" json:"confirmations,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Ring) Reset() { + *x = Ring{} + mi := &file_sourcehub_orbis_ring_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Ring) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Ring) ProtoMessage() {} + +func (x *Ring) ProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_ring_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Ring.ProtoReflect.Descriptor instead. +func (*Ring) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_ring_proto_rawDescGZIP(), []int{0} +} + +func (x *Ring) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Ring) GetCreatorDid() string { + if x != nil { + return x.CreatorDid + } + return "" +} + +func (x *Ring) GetRingPk() string { + if x != nil { + return x.RingPk + } + return "" +} + +func (x *Ring) GetPeerNodeKeys() []string { + if x != nil { + return x.PeerNodeKeys + } + return nil +} + +func (x *Ring) GetThreshold() uint32 { + if x != nil { + return x.Threshold + } + return 0 +} + +func (x *Ring) GetNewPeerNodeKeys() []string { + if x != nil { + return x.NewPeerNodeKeys + } + return nil +} + +func (x *Ring) GetNewThreshold() uint32 { + if x != nil && x.NewThreshold != nil { + return *x.NewThreshold + } + return 0 +} + +func (x *Ring) GetPssInterval() uint64 { + if x != nil && x.PssInterval != nil { + return *x.PssInterval + } + return 0 +} + +func (x *Ring) GetBlockNumberNonce() uint64 { + if x != nil { + return x.BlockNumberNonce + } + return 0 +} + +func (x *Ring) GetPolicyId() string { + if x != nil { + return x.PolicyId + } + return "" +} + +func (x *Ring) GetConfirmations() []*RingConfirmation { + if x != nil { + return x.Confirmations + } + return nil +} + +// RingConfirmation records a single peer's agreement on the ring public key. +type RingConfirmation struct { + state protoimpl.MessageState `protogen:"open.v1"` + NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` + RingPk string `protobuf:"bytes,2,opt,name=ring_pk,json=ringPk,proto3" json:"ring_pk,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RingConfirmation) Reset() { + *x = RingConfirmation{} + mi := &file_sourcehub_orbis_ring_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RingConfirmation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RingConfirmation) ProtoMessage() {} + +func (x *RingConfirmation) ProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_ring_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RingConfirmation.ProtoReflect.Descriptor instead. +func (*RingConfirmation) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_ring_proto_rawDescGZIP(), []int{1} +} + +func (x *RingConfirmation) GetNodeKey() string { + if x != nil { + return x.NodeKey + } + return "" +} + +func (x *RingConfirmation) GetRingPk() string { + if x != nil { + return x.RingPk + } + return "" +} + +var File_sourcehub_orbis_ring_proto protoreflect.FileDescriptor + +const file_sourcehub_orbis_ring_proto_rawDesc = "" + + "\n" + + "\x1asourcehub/orbis/ring.proto\x12\x0fsourcehub.orbis\"\xca\x03\n" + + "\x04Ring\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x1f\n" + + "\vcreator_did\x18\x02 \x01(\tR\n" + + "creatorDid\x12\x17\n" + + "\aring_pk\x18\x03 \x01(\tR\x06ringPk\x12$\n" + + "\x0epeer_node_keys\x18\x04 \x03(\tR\fpeerNodeKeys\x12\x1c\n" + + "\tthreshold\x18\x05 \x01(\rR\tthreshold\x12+\n" + + "\x12new_peer_node_keys\x18\x06 \x03(\tR\x0fnewPeerNodeKeys\x12(\n" + + "\rnew_threshold\x18\a \x01(\rH\x00R\fnewThreshold\x88\x01\x01\x12&\n" + + "\fpss_interval\x18\b \x01(\x04H\x01R\vpssInterval\x88\x01\x01\x12,\n" + + "\x12block_number_nonce\x18\t \x01(\x04R\x10blockNumberNonce\x12\x1b\n" + + "\tpolicy_id\x18\n" + + " \x01(\tR\bpolicyId\x12G\n" + + "\rconfirmations\x18\v \x03(\v2!.sourcehub.orbis.RingConfirmationR\rconfirmationsB\x10\n" + + "\x0e_new_thresholdB\x0f\n" + + "\r_pss_interval\"F\n" + + "\x10RingConfirmation\x12\x19\n" + + "\bnode_key\x18\x01 \x01(\tR\anodeKey\x12\x17\n" + + "\aring_pk\x18\x02 \x01(\tR\x06ringPkB\x9f\x01\n" + + "\x13com.sourcehub.orbisB\tRingProtoP\x01Z cosmossdk.io/api/sourcehub/orbis\xa2\x02\x03SOX\xaa\x02\x0fSourcehub.Orbis\xca\x02\x0fSourcehub\\Orbis\xe2\x02\x1bSourcehub\\Orbis\\GPBMetadata\xea\x02\x10Sourcehub::Orbisb\x06proto3" + +var ( + file_sourcehub_orbis_ring_proto_rawDescOnce sync.Once + file_sourcehub_orbis_ring_proto_rawDescData []byte +) + +func file_sourcehub_orbis_ring_proto_rawDescGZIP() []byte { + file_sourcehub_orbis_ring_proto_rawDescOnce.Do(func() { + file_sourcehub_orbis_ring_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_sourcehub_orbis_ring_proto_rawDesc), len(file_sourcehub_orbis_ring_proto_rawDesc))) + }) + return file_sourcehub_orbis_ring_proto_rawDescData +} + +var file_sourcehub_orbis_ring_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_sourcehub_orbis_ring_proto_goTypes = []any{ + (*Ring)(nil), // 0: sourcehub.orbis.Ring + (*RingConfirmation)(nil), // 1: sourcehub.orbis.RingConfirmation +} +var file_sourcehub_orbis_ring_proto_depIdxs = []int32{ + 1, // 0: sourcehub.orbis.Ring.confirmations:type_name -> sourcehub.orbis.RingConfirmation + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_sourcehub_orbis_ring_proto_init() } +func file_sourcehub_orbis_ring_proto_init() { + if File_sourcehub_orbis_ring_proto != nil { + return + } + file_sourcehub_orbis_ring_proto_msgTypes[0].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_sourcehub_orbis_ring_proto_rawDesc), len(file_sourcehub_orbis_ring_proto_rawDesc)), + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_sourcehub_orbis_ring_proto_goTypes, + DependencyIndexes: file_sourcehub_orbis_ring_proto_depIdxs, + MessageInfos: file_sourcehub_orbis_ring_proto_msgTypes, + }.Build() + File_sourcehub_orbis_ring_proto = out.File + file_sourcehub_orbis_ring_proto_goTypes = nil + file_sourcehub_orbis_ring_proto_depIdxs = nil +} diff --git a/api/sourcehub/orbis/tx.pb.go b/api/sourcehub/orbis/tx.pb.go new file mode 100644 index 00000000..ae17bc06 --- /dev/null +++ b/api/sourcehub/orbis/tx.pb.go @@ -0,0 +1,1492 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc (unknown) +// source: sourcehub/orbis/tx.proto + +package orbis + +import ( + _ "cosmossdk.io/api/amino" + _ "cosmossdk.io/api/cosmos/msg/v1" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams struct { + state protoimpl.MessageState `protogen:"open.v1"` + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MsgUpdateParams) Reset() { + *x = MsgUpdateParams{} + mi := &file_sourcehub_orbis_tx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MsgUpdateParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParams) ProtoMessage() {} + +func (x *MsgUpdateParams) ProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_tx_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MsgUpdateParams.ProtoReflect.Descriptor instead. +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_tx_proto_rawDescGZIP(), []int{0} +} + +func (x *MsgUpdateParams) GetAuthority() string { + if x != nil { + return x.Authority + } + return "" +} + +func (x *MsgUpdateParams) GetParams() *Params { + if x != nil { + return x.Params + } + return nil +} + +// MsgUpdateParamsResponse defines the response structure for MsgUpdateParams. +type MsgUpdateParamsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MsgUpdateParamsResponse) Reset() { + *x = MsgUpdateParamsResponse{} + mi := &file_sourcehub_orbis_tx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MsgUpdateParamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateParamsResponse) ProtoMessage() {} + +func (x *MsgUpdateParamsResponse) ProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_tx_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MsgUpdateParamsResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_tx_proto_rawDescGZIP(), []int{1} +} + +type MsgCreateRing struct { + state protoimpl.MessageState `protogen:"open.v1"` + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + PeerNodeKeys []string `protobuf:"bytes,2,rep,name=peer_node_keys,json=peerNodeKeys,proto3" json:"peer_node_keys,omitempty"` + Threshold uint32 `protobuf:"varint,3,opt,name=threshold,proto3" json:"threshold,omitempty"` + // Absent means automatic PSS refresh is disabled. + PssInterval *uint64 `protobuf:"varint,4,opt,name=pss_interval,json=pssInterval,proto3,oneof" json:"pss_interval,omitempty"` + PolicyId string `protobuf:"bytes,5,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"` + // Absent means no nonce. Provide a nonce to disambiguate rings with identical settings. + Nonce *string `protobuf:"bytes,6,opt,name=nonce,proto3,oneof" json:"nonce,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MsgCreateRing) Reset() { + *x = MsgCreateRing{} + mi := &file_sourcehub_orbis_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MsgCreateRing) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCreateRing) ProtoMessage() {} + +func (x *MsgCreateRing) ProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_tx_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MsgCreateRing.ProtoReflect.Descriptor instead. +func (*MsgCreateRing) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *MsgCreateRing) GetCreator() string { + if x != nil { + return x.Creator + } + return "" +} + +func (x *MsgCreateRing) GetPeerNodeKeys() []string { + if x != nil { + return x.PeerNodeKeys + } + return nil +} + +func (x *MsgCreateRing) GetThreshold() uint32 { + if x != nil { + return x.Threshold + } + return 0 +} + +func (x *MsgCreateRing) GetPssInterval() uint64 { + if x != nil && x.PssInterval != nil { + return *x.PssInterval + } + return 0 +} + +func (x *MsgCreateRing) GetPolicyId() string { + if x != nil { + return x.PolicyId + } + return "" +} + +func (x *MsgCreateRing) GetNonce() string { + if x != nil && x.Nonce != nil { + return *x.Nonce + } + return "" +} + +type MsgCreateRingResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + RingId string `protobuf:"bytes,1,opt,name=ring_id,json=ringId,proto3" json:"ring_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MsgCreateRingResponse) Reset() { + *x = MsgCreateRingResponse{} + mi := &file_sourcehub_orbis_tx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MsgCreateRingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCreateRingResponse) ProtoMessage() {} + +func (x *MsgCreateRingResponse) ProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_tx_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MsgCreateRingResponse.ProtoReflect.Descriptor instead. +func (*MsgCreateRingResponse) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_tx_proto_rawDescGZIP(), []int{3} +} + +func (x *MsgCreateRingResponse) GetRingId() string { + if x != nil { + return x.RingId + } + return "" +} + +type MsgFinalizeRing struct { + state protoimpl.MessageState `protogen:"open.v1"` + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + RingId string `protobuf:"bytes,2,opt,name=ring_id,json=ringId,proto3" json:"ring_id,omitempty"` + RingPk string `protobuf:"bytes,3,opt,name=ring_pk,json=ringPk,proto3" json:"ring_pk,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MsgFinalizeRing) Reset() { + *x = MsgFinalizeRing{} + mi := &file_sourcehub_orbis_tx_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MsgFinalizeRing) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgFinalizeRing) ProtoMessage() {} + +func (x *MsgFinalizeRing) ProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_tx_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MsgFinalizeRing.ProtoReflect.Descriptor instead. +func (*MsgFinalizeRing) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_tx_proto_rawDescGZIP(), []int{4} +} + +func (x *MsgFinalizeRing) GetCreator() string { + if x != nil { + return x.Creator + } + return "" +} + +func (x *MsgFinalizeRing) GetRingId() string { + if x != nil { + return x.RingId + } + return "" +} + +func (x *MsgFinalizeRing) GetRingPk() string { + if x != nil { + return x.RingPk + } + return "" +} + +type MsgFinalizeRingResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MsgFinalizeRingResponse) Reset() { + *x = MsgFinalizeRingResponse{} + mi := &file_sourcehub_orbis_tx_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MsgFinalizeRingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgFinalizeRingResponse) ProtoMessage() {} + +func (x *MsgFinalizeRingResponse) ProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_tx_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MsgFinalizeRingResponse.ProtoReflect.Descriptor instead. +func (*MsgFinalizeRingResponse) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_tx_proto_rawDescGZIP(), []int{5} +} + +type MsgUpdateRingByAcp struct { + state protoimpl.MessageState `protogen:"open.v1"` + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + RingId string `protobuf:"bytes,2,opt,name=ring_id,json=ringId,proto3" json:"ring_id,omitempty"` + NewPeerNodeKeys []string `protobuf:"bytes,3,rep,name=new_peer_node_keys,json=newPeerNodeKeys,proto3" json:"new_peer_node_keys,omitempty"` + // Absent means no pending threshold update. + NewThreshold *uint32 `protobuf:"varint,4,opt,name=new_threshold,json=newThreshold,proto3,oneof" json:"new_threshold,omitempty"` + // Absent means no PSS refresh interval update. + PssInterval *uint64 `protobuf:"varint,5,opt,name=pss_interval,json=pssInterval,proto3,oneof" json:"pss_interval,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MsgUpdateRingByAcp) Reset() { + *x = MsgUpdateRingByAcp{} + mi := &file_sourcehub_orbis_tx_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MsgUpdateRingByAcp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateRingByAcp) ProtoMessage() {} + +func (x *MsgUpdateRingByAcp) ProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_tx_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MsgUpdateRingByAcp.ProtoReflect.Descriptor instead. +func (*MsgUpdateRingByAcp) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_tx_proto_rawDescGZIP(), []int{6} +} + +func (x *MsgUpdateRingByAcp) GetCreator() string { + if x != nil { + return x.Creator + } + return "" +} + +func (x *MsgUpdateRingByAcp) GetRingId() string { + if x != nil { + return x.RingId + } + return "" +} + +func (x *MsgUpdateRingByAcp) GetNewPeerNodeKeys() []string { + if x != nil { + return x.NewPeerNodeKeys + } + return nil +} + +func (x *MsgUpdateRingByAcp) GetNewThreshold() uint32 { + if x != nil && x.NewThreshold != nil { + return *x.NewThreshold + } + return 0 +} + +func (x *MsgUpdateRingByAcp) GetPssInterval() uint64 { + if x != nil && x.PssInterval != nil { + return *x.PssInterval + } + return 0 +} + +type MsgUpdateRingByAcpResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MsgUpdateRingByAcpResponse) Reset() { + *x = MsgUpdateRingByAcpResponse{} + mi := &file_sourcehub_orbis_tx_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MsgUpdateRingByAcpResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateRingByAcpResponse) ProtoMessage() {} + +func (x *MsgUpdateRingByAcpResponse) ProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_tx_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MsgUpdateRingByAcpResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateRingByAcpResponse) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_tx_proto_rawDescGZIP(), []int{7} +} + +type MsgFinalizeRingReshareByThresholdSignature struct { + state protoimpl.MessageState `protogen:"open.v1"` + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + RingId string `protobuf:"bytes,2,opt,name=ring_id,json=ringId,proto3" json:"ring_id,omitempty"` + SignatureScheme string `protobuf:"bytes,3,opt,name=signature_scheme,json=signatureScheme,proto3" json:"signature_scheme,omitempty"` + Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MsgFinalizeRingReshareByThresholdSignature) Reset() { + *x = MsgFinalizeRingReshareByThresholdSignature{} + mi := &file_sourcehub_orbis_tx_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MsgFinalizeRingReshareByThresholdSignature) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgFinalizeRingReshareByThresholdSignature) ProtoMessage() {} + +func (x *MsgFinalizeRingReshareByThresholdSignature) ProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_tx_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MsgFinalizeRingReshareByThresholdSignature.ProtoReflect.Descriptor instead. +func (*MsgFinalizeRingReshareByThresholdSignature) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_tx_proto_rawDescGZIP(), []int{8} +} + +func (x *MsgFinalizeRingReshareByThresholdSignature) GetCreator() string { + if x != nil { + return x.Creator + } + return "" +} + +func (x *MsgFinalizeRingReshareByThresholdSignature) GetRingId() string { + if x != nil { + return x.RingId + } + return "" +} + +func (x *MsgFinalizeRingReshareByThresholdSignature) GetSignatureScheme() string { + if x != nil { + return x.SignatureScheme + } + return "" +} + +func (x *MsgFinalizeRingReshareByThresholdSignature) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +type MsgFinalizeRingReshareByThresholdSignatureResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MsgFinalizeRingReshareByThresholdSignatureResponse) Reset() { + *x = MsgFinalizeRingReshareByThresholdSignatureResponse{} + mi := &file_sourcehub_orbis_tx_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MsgFinalizeRingReshareByThresholdSignatureResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgFinalizeRingReshareByThresholdSignatureResponse) ProtoMessage() {} + +func (x *MsgFinalizeRingReshareByThresholdSignatureResponse) ProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_tx_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MsgFinalizeRingReshareByThresholdSignatureResponse.ProtoReflect.Descriptor instead. +func (*MsgFinalizeRingReshareByThresholdSignatureResponse) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_tx_proto_rawDescGZIP(), []int{9} +} + +type RingReshareFinalizeSignDoc struct { + state protoimpl.MessageState `protogen:"open.v1"` + Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"` + ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + RingId string `protobuf:"bytes,3,opt,name=ring_id,json=ringId,proto3" json:"ring_id,omitempty"` + RingPk string `protobuf:"bytes,4,opt,name=ring_pk,json=ringPk,proto3" json:"ring_pk,omitempty"` + CurrentRingSha256 []byte `protobuf:"bytes,5,opt,name=current_ring_sha256,json=currentRingSha256,proto3" json:"current_ring_sha256,omitempty"` + FinalizedRingSha256 []byte `protobuf:"bytes,6,opt,name=finalized_ring_sha256,json=finalizedRingSha256,proto3" json:"finalized_ring_sha256,omitempty"` + BlockNumberNonce uint64 `protobuf:"varint,7,opt,name=block_number_nonce,json=blockNumberNonce,proto3" json:"block_number_nonce,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RingReshareFinalizeSignDoc) Reset() { + *x = RingReshareFinalizeSignDoc{} + mi := &file_sourcehub_orbis_tx_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RingReshareFinalizeSignDoc) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RingReshareFinalizeSignDoc) ProtoMessage() {} + +func (x *RingReshareFinalizeSignDoc) ProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_tx_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RingReshareFinalizeSignDoc.ProtoReflect.Descriptor instead. +func (*RingReshareFinalizeSignDoc) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_tx_proto_rawDescGZIP(), []int{10} +} + +func (x *RingReshareFinalizeSignDoc) GetDomain() string { + if x != nil { + return x.Domain + } + return "" +} + +func (x *RingReshareFinalizeSignDoc) GetChainId() string { + if x != nil { + return x.ChainId + } + return "" +} + +func (x *RingReshareFinalizeSignDoc) GetRingId() string { + if x != nil { + return x.RingId + } + return "" +} + +func (x *RingReshareFinalizeSignDoc) GetRingPk() string { + if x != nil { + return x.RingPk + } + return "" +} + +func (x *RingReshareFinalizeSignDoc) GetCurrentRingSha256() []byte { + if x != nil { + return x.CurrentRingSha256 + } + return nil +} + +func (x *RingReshareFinalizeSignDoc) GetFinalizedRingSha256() []byte { + if x != nil { + return x.FinalizedRingSha256 + } + return nil +} + +func (x *RingReshareFinalizeSignDoc) GetBlockNumberNonce() uint64 { + if x != nil { + return x.BlockNumberNonce + } + return 0 +} + +type RingReshareSignState struct { + state protoimpl.MessageState `protogen:"open.v1"` + RingPk string `protobuf:"bytes,1,opt,name=ring_pk,json=ringPk,proto3" json:"ring_pk,omitempty"` + PeerNodeKeys []string `protobuf:"bytes,2,rep,name=peer_node_keys,json=peerNodeKeys,proto3" json:"peer_node_keys,omitempty"` + Threshold uint32 `protobuf:"varint,3,opt,name=threshold,proto3" json:"threshold,omitempty"` + NewPeerNodeKeys []string `protobuf:"bytes,4,rep,name=new_peer_node_keys,json=newPeerNodeKeys,proto3" json:"new_peer_node_keys,omitempty"` + NewThreshold *uint32 `protobuf:"varint,5,opt,name=new_threshold,json=newThreshold,proto3,oneof" json:"new_threshold,omitempty"` + PssInterval *uint64 `protobuf:"varint,6,opt,name=pss_interval,json=pssInterval,proto3,oneof" json:"pss_interval,omitempty"` + BlockNumberNonce uint64 `protobuf:"varint,7,opt,name=block_number_nonce,json=blockNumberNonce,proto3" json:"block_number_nonce,omitempty"` + PolicyId string `protobuf:"bytes,8,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RingReshareSignState) Reset() { + *x = RingReshareSignState{} + mi := &file_sourcehub_orbis_tx_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RingReshareSignState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RingReshareSignState) ProtoMessage() {} + +func (x *RingReshareSignState) ProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_tx_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RingReshareSignState.ProtoReflect.Descriptor instead. +func (*RingReshareSignState) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_tx_proto_rawDescGZIP(), []int{11} +} + +func (x *RingReshareSignState) GetRingPk() string { + if x != nil { + return x.RingPk + } + return "" +} + +func (x *RingReshareSignState) GetPeerNodeKeys() []string { + if x != nil { + return x.PeerNodeKeys + } + return nil +} + +func (x *RingReshareSignState) GetThreshold() uint32 { + if x != nil { + return x.Threshold + } + return 0 +} + +func (x *RingReshareSignState) GetNewPeerNodeKeys() []string { + if x != nil { + return x.NewPeerNodeKeys + } + return nil +} + +func (x *RingReshareSignState) GetNewThreshold() uint32 { + if x != nil && x.NewThreshold != nil { + return *x.NewThreshold + } + return 0 +} + +func (x *RingReshareSignState) GetPssInterval() uint64 { + if x != nil && x.PssInterval != nil { + return *x.PssInterval + } + return 0 +} + +func (x *RingReshareSignState) GetBlockNumberNonce() uint64 { + if x != nil { + return x.BlockNumberNonce + } + return 0 +} + +func (x *RingReshareSignState) GetPolicyId() string { + if x != nil { + return x.PolicyId + } + return "" +} + +type MsgStoreDocument struct { + state protoimpl.MessageState `protogen:"open.v1"` + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + RingId string `protobuf:"bytes,2,opt,name=ring_id,json=ringId,proto3" json:"ring_id,omitempty"` + Document string `protobuf:"bytes,3,opt,name=document,proto3" json:"document,omitempty"` + Proof string `protobuf:"bytes,4,opt,name=proof,proto3" json:"proof,omitempty"` + PolicyId string `protobuf:"bytes,5,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"` + Resource string `protobuf:"bytes,6,opt,name=resource,proto3" json:"resource,omitempty"` + Permission string `protobuf:"bytes,7,opt,name=permission,proto3" json:"permission,omitempty"` + // Absent means no tier. + Tier *string `protobuf:"bytes,8,opt,name=tier,proto3,oneof" json:"tier,omitempty"` + // Absent means no timestamp. + Timestamp *uint64 `protobuf:"varint,9,opt,name=timestamp,proto3,oneof" json:"timestamp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MsgStoreDocument) Reset() { + *x = MsgStoreDocument{} + mi := &file_sourcehub_orbis_tx_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MsgStoreDocument) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgStoreDocument) ProtoMessage() {} + +func (x *MsgStoreDocument) ProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_tx_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MsgStoreDocument.ProtoReflect.Descriptor instead. +func (*MsgStoreDocument) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_tx_proto_rawDescGZIP(), []int{12} +} + +func (x *MsgStoreDocument) GetCreator() string { + if x != nil { + return x.Creator + } + return "" +} + +func (x *MsgStoreDocument) GetRingId() string { + if x != nil { + return x.RingId + } + return "" +} + +func (x *MsgStoreDocument) GetDocument() string { + if x != nil { + return x.Document + } + return "" +} + +func (x *MsgStoreDocument) GetProof() string { + if x != nil { + return x.Proof + } + return "" +} + +func (x *MsgStoreDocument) GetPolicyId() string { + if x != nil { + return x.PolicyId + } + return "" +} + +func (x *MsgStoreDocument) GetResource() string { + if x != nil { + return x.Resource + } + return "" +} + +func (x *MsgStoreDocument) GetPermission() string { + if x != nil { + return x.Permission + } + return "" +} + +func (x *MsgStoreDocument) GetTier() string { + if x != nil && x.Tier != nil { + return *x.Tier + } + return "" +} + +func (x *MsgStoreDocument) GetTimestamp() uint64 { + if x != nil && x.Timestamp != nil { + return *x.Timestamp + } + return 0 +} + +type MsgStoreDocumentResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MsgStoreDocumentResponse) Reset() { + *x = MsgStoreDocumentResponse{} + mi := &file_sourcehub_orbis_tx_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MsgStoreDocumentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgStoreDocumentResponse) ProtoMessage() {} + +func (x *MsgStoreDocumentResponse) ProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_tx_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MsgStoreDocumentResponse.ProtoReflect.Descriptor instead. +func (*MsgStoreDocumentResponse) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_tx_proto_rawDescGZIP(), []int{13} +} + +func (x *MsgStoreDocumentResponse) GetDocumentId() string { + if x != nil { + return x.DocumentId + } + return "" +} + +type MsgStoreKeyDerivation struct { + state protoimpl.MessageState `protogen:"open.v1"` + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + RingId string `protobuf:"bytes,2,opt,name=ring_id,json=ringId,proto3" json:"ring_id,omitempty"` + Derivation string `protobuf:"bytes,3,opt,name=derivation,proto3" json:"derivation,omitempty"` + PolicyId string `protobuf:"bytes,4,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"` + Resource string `protobuf:"bytes,5,opt,name=resource,proto3" json:"resource,omitempty"` + Permission string `protobuf:"bytes,6,opt,name=permission,proto3" json:"permission,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MsgStoreKeyDerivation) Reset() { + *x = MsgStoreKeyDerivation{} + mi := &file_sourcehub_orbis_tx_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MsgStoreKeyDerivation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgStoreKeyDerivation) ProtoMessage() {} + +func (x *MsgStoreKeyDerivation) ProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_tx_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MsgStoreKeyDerivation.ProtoReflect.Descriptor instead. +func (*MsgStoreKeyDerivation) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_tx_proto_rawDescGZIP(), []int{14} +} + +func (x *MsgStoreKeyDerivation) GetCreator() string { + if x != nil { + return x.Creator + } + return "" +} + +func (x *MsgStoreKeyDerivation) GetRingId() string { + if x != nil { + return x.RingId + } + return "" +} + +func (x *MsgStoreKeyDerivation) GetDerivation() string { + if x != nil { + return x.Derivation + } + return "" +} + +func (x *MsgStoreKeyDerivation) GetPolicyId() string { + if x != nil { + return x.PolicyId + } + return "" +} + +func (x *MsgStoreKeyDerivation) GetResource() string { + if x != nil { + return x.Resource + } + return "" +} + +func (x *MsgStoreKeyDerivation) GetPermission() string { + if x != nil { + return x.Permission + } + return "" +} + +type MsgStoreKeyDerivationResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + KeyDerivationId string `protobuf:"bytes,1,opt,name=key_derivation_id,json=keyDerivationId,proto3" json:"key_derivation_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MsgStoreKeyDerivationResponse) Reset() { + *x = MsgStoreKeyDerivationResponse{} + mi := &file_sourcehub_orbis_tx_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MsgStoreKeyDerivationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgStoreKeyDerivationResponse) ProtoMessage() {} + +func (x *MsgStoreKeyDerivationResponse) ProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_tx_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MsgStoreKeyDerivationResponse.ProtoReflect.Descriptor instead. +func (*MsgStoreKeyDerivationResponse) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_tx_proto_rawDescGZIP(), []int{15} +} + +func (x *MsgStoreKeyDerivationResponse) GetKeyDerivationId() string { + if x != nil { + return x.KeyDerivationId + } + return "" +} + +type MsgCreateNodeInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + PeerId string `protobuf:"bytes,2,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` + ControllerKey string `protobuf:"bytes,3,opt,name=controller_key,json=controllerKey,proto3" json:"controller_key,omitempty"` + WhitelistedPolicyIds []string `protobuf:"bytes,4,rep,name=whitelisted_policy_ids,json=whitelistedPolicyIds,proto3" json:"whitelisted_policy_ids,omitempty"` + WhitelistedRingIds []string `protobuf:"bytes,5,rep,name=whitelisted_ring_ids,json=whitelistedRingIds,proto3" json:"whitelisted_ring_ids,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MsgCreateNodeInfo) Reset() { + *x = MsgCreateNodeInfo{} + mi := &file_sourcehub_orbis_tx_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MsgCreateNodeInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCreateNodeInfo) ProtoMessage() {} + +func (x *MsgCreateNodeInfo) ProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_tx_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MsgCreateNodeInfo.ProtoReflect.Descriptor instead. +func (*MsgCreateNodeInfo) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_tx_proto_rawDescGZIP(), []int{16} +} + +func (x *MsgCreateNodeInfo) GetCreator() string { + if x != nil { + return x.Creator + } + return "" +} + +func (x *MsgCreateNodeInfo) GetPeerId() string { + if x != nil { + return x.PeerId + } + return "" +} + +func (x *MsgCreateNodeInfo) GetControllerKey() string { + if x != nil { + return x.ControllerKey + } + return "" +} + +func (x *MsgCreateNodeInfo) GetWhitelistedPolicyIds() []string { + if x != nil { + return x.WhitelistedPolicyIds + } + return nil +} + +func (x *MsgCreateNodeInfo) GetWhitelistedRingIds() []string { + if x != nil { + return x.WhitelistedRingIds + } + return nil +} + +type MsgCreateNodeInfoResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MsgCreateNodeInfoResponse) Reset() { + *x = MsgCreateNodeInfoResponse{} + mi := &file_sourcehub_orbis_tx_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MsgCreateNodeInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgCreateNodeInfoResponse) ProtoMessage() {} + +func (x *MsgCreateNodeInfoResponse) ProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_tx_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MsgCreateNodeInfoResponse.ProtoReflect.Descriptor instead. +func (*MsgCreateNodeInfoResponse) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_tx_proto_rawDescGZIP(), []int{17} +} + +// MsgUpdateNodeInfo replaces mutable fields on an existing NodeInfo record. +// The signer must be the current controller_key holder. +// +// IMPORTANT: whitelisted_policy_ids and whitelisted_ring_ids are REPLACED in +// full, not merged. To add a single entry you must re-send the complete desired +// list. Sending an empty repeated field clears the whitelist entirely. +type MsgUpdateNodeInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + NodeKey string `protobuf:"bytes,2,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` + // Absent means no peer_id update. + PeerId *string `protobuf:"bytes,3,opt,name=peer_id,json=peerId,proto3,oneof" json:"peer_id,omitempty"` + // Replaces the full policy whitelist. Send the complete desired list on every + // update; an empty field clears all whitelisted policies. + WhitelistedPolicyIds []string `protobuf:"bytes,4,rep,name=whitelisted_policy_ids,json=whitelistedPolicyIds,proto3" json:"whitelisted_policy_ids,omitempty"` + // Replaces the full ring whitelist. Send the complete desired list on every + // update; an empty field clears all whitelisted rings. + WhitelistedRingIds []string `protobuf:"bytes,5,rep,name=whitelisted_ring_ids,json=whitelistedRingIds,proto3" json:"whitelisted_ring_ids,omitempty"` + // Absent means no controller_key update. + ControllerKey *string `protobuf:"bytes,6,opt,name=controller_key,json=controllerKey,proto3,oneof" json:"controller_key,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MsgUpdateNodeInfo) Reset() { + *x = MsgUpdateNodeInfo{} + mi := &file_sourcehub_orbis_tx_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MsgUpdateNodeInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateNodeInfo) ProtoMessage() {} + +func (x *MsgUpdateNodeInfo) ProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_tx_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MsgUpdateNodeInfo.ProtoReflect.Descriptor instead. +func (*MsgUpdateNodeInfo) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_tx_proto_rawDescGZIP(), []int{18} +} + +func (x *MsgUpdateNodeInfo) GetCreator() string { + if x != nil { + return x.Creator + } + return "" +} + +func (x *MsgUpdateNodeInfo) GetNodeKey() string { + if x != nil { + return x.NodeKey + } + return "" +} + +func (x *MsgUpdateNodeInfo) GetPeerId() string { + if x != nil && x.PeerId != nil { + return *x.PeerId + } + return "" +} + +func (x *MsgUpdateNodeInfo) GetWhitelistedPolicyIds() []string { + if x != nil { + return x.WhitelistedPolicyIds + } + return nil +} + +func (x *MsgUpdateNodeInfo) GetWhitelistedRingIds() []string { + if x != nil { + return x.WhitelistedRingIds + } + return nil +} + +func (x *MsgUpdateNodeInfo) GetControllerKey() string { + if x != nil && x.ControllerKey != nil { + return *x.ControllerKey + } + return "" +} + +type MsgUpdateNodeInfoResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MsgUpdateNodeInfoResponse) Reset() { + *x = MsgUpdateNodeInfoResponse{} + mi := &file_sourcehub_orbis_tx_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MsgUpdateNodeInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgUpdateNodeInfoResponse) ProtoMessage() {} + +func (x *MsgUpdateNodeInfoResponse) ProtoReflect() protoreflect.Message { + mi := &file_sourcehub_orbis_tx_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MsgUpdateNodeInfoResponse.ProtoReflect.Descriptor instead. +func (*MsgUpdateNodeInfoResponse) Descriptor() ([]byte, []int) { + return file_sourcehub_orbis_tx_proto_rawDescGZIP(), []int{19} +} + +var File_sourcehub_orbis_tx_proto protoreflect.FileDescriptor + +const file_sourcehub_orbis_tx_proto_rawDesc = "" + + "\n" + + "\x18sourcehub/orbis/tx.proto\x12\x0fsourcehub.orbis\x1a\x11amino/amino.proto\x1a\x17cosmos/msg/v1/msg.proto\x1a\x19cosmos_proto/cosmos.proto\x1a\x14gogoproto/gogo.proto\x1a\x1csourcehub/orbis/params.proto\"\xbb\x01\n" + + "\x0fMsgUpdateParams\x126\n" + + "\tauthority\x18\x01 \x01(\tB\x18Ҵ-\x14cosmos.AddressStringR\tauthority\x12:\n" + + "\x06params\x18\x02 \x01(\v2\x17.sourcehub.orbis.ParamsB\t\xc8\xde\x1f\x00\xa8\xe7\xb0*\x01R\x06params:4\x82\xe7\xb0*\tauthority\x8a\xe7\xb0*!sourcehub/x/orbis/MsgUpdateParams\"\x19\n" + + "\x17MsgUpdateParamsResponse\"\xf6\x01\n" + + "\rMsgCreateRing\x12\x18\n" + + "\acreator\x18\x01 \x01(\tR\acreator\x12$\n" + + "\x0epeer_node_keys\x18\x02 \x03(\tR\fpeerNodeKeys\x12\x1c\n" + + "\tthreshold\x18\x03 \x01(\rR\tthreshold\x12&\n" + + "\fpss_interval\x18\x04 \x01(\x04H\x00R\vpssInterval\x88\x01\x01\x12\x1b\n" + + "\tpolicy_id\x18\x05 \x01(\tR\bpolicyId\x12\x19\n" + + "\x05nonce\x18\x06 \x01(\tH\x01R\x05nonce\x88\x01\x01:\f\x82\xe7\xb0*\acreatorB\x0f\n" + + "\r_pss_intervalB\b\n" + + "\x06_nonce\"0\n" + + "\x15MsgCreateRingResponse\x12\x17\n" + + "\aring_id\x18\x01 \x01(\tR\x06ringId\"k\n" + + "\x0fMsgFinalizeRing\x12\x18\n" + + "\acreator\x18\x01 \x01(\tR\acreator\x12\x17\n" + + "\aring_id\x18\x02 \x01(\tR\x06ringId\x12\x17\n" + + "\aring_pk\x18\x03 \x01(\tR\x06ringPk:\f\x82\xe7\xb0*\acreator\"\x19\n" + + "\x17MsgFinalizeRingResponse\"\xf7\x01\n" + + "\x12MsgUpdateRingByAcp\x12\x18\n" + + "\acreator\x18\x01 \x01(\tR\acreator\x12\x17\n" + + "\aring_id\x18\x02 \x01(\tR\x06ringId\x12+\n" + + "\x12new_peer_node_keys\x18\x03 \x03(\tR\x0fnewPeerNodeKeys\x12(\n" + + "\rnew_threshold\x18\x04 \x01(\rH\x00R\fnewThreshold\x88\x01\x01\x12&\n" + + "\fpss_interval\x18\x05 \x01(\x04H\x01R\vpssInterval\x88\x01\x01:\f\x82\xe7\xb0*\acreatorB\x10\n" + + "\x0e_new_thresholdB\x0f\n" + + "\r_pss_interval\"\x1c\n" + + "\x1aMsgUpdateRingByAcpResponse\"\xb6\x01\n" + + "*MsgFinalizeRingReshareByThresholdSignature\x12\x18\n" + + "\acreator\x18\x01 \x01(\tR\acreator\x12\x17\n" + + "\aring_id\x18\x02 \x01(\tR\x06ringId\x12)\n" + + "\x10signature_scheme\x18\x03 \x01(\tR\x0fsignatureScheme\x12\x1c\n" + + "\tsignature\x18\x04 \x01(\fR\tsignature:\f\x82\xe7\xb0*\acreator\"4\n" + + "2MsgFinalizeRingReshareByThresholdSignatureResponse\"\x93\x02\n" + + "\x1aRingReshareFinalizeSignDoc\x12\x16\n" + + "\x06domain\x18\x01 \x01(\tR\x06domain\x12\x19\n" + + "\bchain_id\x18\x02 \x01(\tR\achainId\x12\x17\n" + + "\aring_id\x18\x03 \x01(\tR\x06ringId\x12\x17\n" + + "\aring_pk\x18\x04 \x01(\tR\x06ringPk\x12.\n" + + "\x13current_ring_sha256\x18\x05 \x01(\fR\x11currentRingSha256\x122\n" + + "\x15finalized_ring_sha256\x18\x06 \x01(\fR\x13finalizedRingSha256\x12,\n" + + "\x12block_number_nonce\x18\a \x01(\x04R\x10blockNumberNonce\"\xe0\x02\n" + + "\x14RingReshareSignState\x12\x17\n" + + "\aring_pk\x18\x01 \x01(\tR\x06ringPk\x12$\n" + + "\x0epeer_node_keys\x18\x02 \x03(\tR\fpeerNodeKeys\x12\x1c\n" + + "\tthreshold\x18\x03 \x01(\rR\tthreshold\x12+\n" + + "\x12new_peer_node_keys\x18\x04 \x03(\tR\x0fnewPeerNodeKeys\x12(\n" + + "\rnew_threshold\x18\x05 \x01(\rH\x00R\fnewThreshold\x88\x01\x01\x12&\n" + + "\fpss_interval\x18\x06 \x01(\x04H\x01R\vpssInterval\x88\x01\x01\x12,\n" + + "\x12block_number_nonce\x18\a \x01(\x04R\x10blockNumberNonce\x12\x1b\n" + + "\tpolicy_id\x18\b \x01(\tR\bpolicyIdB\x10\n" + + "\x0e_new_thresholdB\x0f\n" + + "\r_pss_interval\"\xb1\x02\n" + + "\x10MsgStoreDocument\x12\x18\n" + + "\acreator\x18\x01 \x01(\tR\acreator\x12\x17\n" + + "\aring_id\x18\x02 \x01(\tR\x06ringId\x12\x1a\n" + + "\bdocument\x18\x03 \x01(\tR\bdocument\x12\x14\n" + + "\x05proof\x18\x04 \x01(\tR\x05proof\x12\x1b\n" + + "\tpolicy_id\x18\x05 \x01(\tR\bpolicyId\x12\x1a\n" + + "\bresource\x18\x06 \x01(\tR\bresource\x12\x1e\n" + + "\n" + + "permission\x18\a \x01(\tR\n" + + "permission\x12\x17\n" + + "\x04tier\x18\b \x01(\tH\x00R\x04tier\x88\x01\x01\x12!\n" + + "\ttimestamp\x18\t \x01(\x04H\x01R\ttimestamp\x88\x01\x01:\f\x82\xe7\xb0*\acreatorB\a\n" + + "\x05_tierB\f\n" + + "\n" + + "_timestamp\";\n" + + "\x18MsgStoreDocumentResponse\x12\x1f\n" + + "\vdocument_id\x18\x01 \x01(\tR\n" + + "documentId\"\xd1\x01\n" + + "\x15MsgStoreKeyDerivation\x12\x18\n" + + "\acreator\x18\x01 \x01(\tR\acreator\x12\x17\n" + + "\aring_id\x18\x02 \x01(\tR\x06ringId\x12\x1e\n" + + "\n" + + "derivation\x18\x03 \x01(\tR\n" + + "derivation\x12\x1b\n" + + "\tpolicy_id\x18\x04 \x01(\tR\bpolicyId\x12\x1a\n" + + "\bresource\x18\x05 \x01(\tR\bresource\x12\x1e\n" + + "\n" + + "permission\x18\x06 \x01(\tR\n" + + "permission:\f\x82\xe7\xb0*\acreator\"K\n" + + "\x1dMsgStoreKeyDerivationResponse\x12*\n" + + "\x11key_derivation_id\x18\x01 \x01(\tR\x0fkeyDerivationId\"\xe3\x01\n" + + "\x11MsgCreateNodeInfo\x12\x18\n" + + "\acreator\x18\x01 \x01(\tR\acreator\x12\x17\n" + + "\apeer_id\x18\x02 \x01(\tR\x06peerId\x12%\n" + + "\x0econtroller_key\x18\x03 \x01(\tR\rcontrollerKey\x124\n" + + "\x16whitelisted_policy_ids\x18\x04 \x03(\tR\x14whitelistedPolicyIds\x120\n" + + "\x14whitelisted_ring_ids\x18\x05 \x03(\tR\x12whitelistedRingIds:\f\x82\xe7\xb0*\acreator\"\x1b\n" + + "\x19MsgCreateNodeInfoResponse\"\xa7\x02\n" + + "\x11MsgUpdateNodeInfo\x12\x18\n" + + "\acreator\x18\x01 \x01(\tR\acreator\x12\x19\n" + + "\bnode_key\x18\x02 \x01(\tR\anodeKey\x12\x1c\n" + + "\apeer_id\x18\x03 \x01(\tH\x00R\x06peerId\x88\x01\x01\x124\n" + + "\x16whitelisted_policy_ids\x18\x04 \x03(\tR\x14whitelistedPolicyIds\x120\n" + + "\x14whitelisted_ring_ids\x18\x05 \x03(\tR\x12whitelistedRingIds\x12*\n" + + "\x0econtroller_key\x18\x06 \x01(\tH\x01R\rcontrollerKey\x88\x01\x01:\f\x82\xe7\xb0*\acreatorB\n" + + "\n" + + "\b_peer_idB\x11\n" + + "\x0f_controller_key\"\x1b\n" + + "\x19MsgUpdateNodeInfoResponse2\xbe\a\n" + + "\x03Msg\x12Z\n" + + "\fUpdateParams\x12 .sourcehub.orbis.MsgUpdateParams\x1a(.sourcehub.orbis.MsgUpdateParamsResponse\x12T\n" + + "\n" + + "CreateRing\x12\x1e.sourcehub.orbis.MsgCreateRing\x1a&.sourcehub.orbis.MsgCreateRingResponse\x12Z\n" + + "\fFinalizeRing\x12 .sourcehub.orbis.MsgFinalizeRing\x1a(.sourcehub.orbis.MsgFinalizeRingResponse\x12c\n" + + "\x0fUpdateRingByAcp\x12#.sourcehub.orbis.MsgUpdateRingByAcp\x1a+.sourcehub.orbis.MsgUpdateRingByAcpResponse\x12\xab\x01\n" + + "'FinalizeRingReshareByThresholdSignature\x12;.sourcehub.orbis.MsgFinalizeRingReshareByThresholdSignature\x1aC.sourcehub.orbis.MsgFinalizeRingReshareByThresholdSignatureResponse\x12]\n" + + "\rStoreDocument\x12!.sourcehub.orbis.MsgStoreDocument\x1a).sourcehub.orbis.MsgStoreDocumentResponse\x12l\n" + + "\x12StoreKeyDerivation\x12&.sourcehub.orbis.MsgStoreKeyDerivation\x1a..sourcehub.orbis.MsgStoreKeyDerivationResponse\x12`\n" + + "\x0eCreateNodeInfo\x12\".sourcehub.orbis.MsgCreateNodeInfo\x1a*.sourcehub.orbis.MsgCreateNodeInfoResponse\x12`\n" + + "\x0eUpdateNodeInfo\x12\".sourcehub.orbis.MsgUpdateNodeInfo\x1a*.sourcehub.orbis.MsgUpdateNodeInfoResponse\x1a\x05\x80\xe7\xb0*\x01B\x9d\x01\n" + + "\x13com.sourcehub.orbisB\aTxProtoP\x01Z cosmossdk.io/api/sourcehub/orbis\xa2\x02\x03SOX\xaa\x02\x0fSourcehub.Orbis\xca\x02\x0fSourcehub\\Orbis\xe2\x02\x1bSourcehub\\Orbis\\GPBMetadata\xea\x02\x10Sourcehub::Orbisb\x06proto3" + +var ( + file_sourcehub_orbis_tx_proto_rawDescOnce sync.Once + file_sourcehub_orbis_tx_proto_rawDescData []byte +) + +func file_sourcehub_orbis_tx_proto_rawDescGZIP() []byte { + file_sourcehub_orbis_tx_proto_rawDescOnce.Do(func() { + file_sourcehub_orbis_tx_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_sourcehub_orbis_tx_proto_rawDesc), len(file_sourcehub_orbis_tx_proto_rawDesc))) + }) + return file_sourcehub_orbis_tx_proto_rawDescData +} + +var file_sourcehub_orbis_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_sourcehub_orbis_tx_proto_goTypes = []any{ + (*MsgUpdateParams)(nil), // 0: sourcehub.orbis.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 1: sourcehub.orbis.MsgUpdateParamsResponse + (*MsgCreateRing)(nil), // 2: sourcehub.orbis.MsgCreateRing + (*MsgCreateRingResponse)(nil), // 3: sourcehub.orbis.MsgCreateRingResponse + (*MsgFinalizeRing)(nil), // 4: sourcehub.orbis.MsgFinalizeRing + (*MsgFinalizeRingResponse)(nil), // 5: sourcehub.orbis.MsgFinalizeRingResponse + (*MsgUpdateRingByAcp)(nil), // 6: sourcehub.orbis.MsgUpdateRingByAcp + (*MsgUpdateRingByAcpResponse)(nil), // 7: sourcehub.orbis.MsgUpdateRingByAcpResponse + (*MsgFinalizeRingReshareByThresholdSignature)(nil), // 8: sourcehub.orbis.MsgFinalizeRingReshareByThresholdSignature + (*MsgFinalizeRingReshareByThresholdSignatureResponse)(nil), // 9: sourcehub.orbis.MsgFinalizeRingReshareByThresholdSignatureResponse + (*RingReshareFinalizeSignDoc)(nil), // 10: sourcehub.orbis.RingReshareFinalizeSignDoc + (*RingReshareSignState)(nil), // 11: sourcehub.orbis.RingReshareSignState + (*MsgStoreDocument)(nil), // 12: sourcehub.orbis.MsgStoreDocument + (*MsgStoreDocumentResponse)(nil), // 13: sourcehub.orbis.MsgStoreDocumentResponse + (*MsgStoreKeyDerivation)(nil), // 14: sourcehub.orbis.MsgStoreKeyDerivation + (*MsgStoreKeyDerivationResponse)(nil), // 15: sourcehub.orbis.MsgStoreKeyDerivationResponse + (*MsgCreateNodeInfo)(nil), // 16: sourcehub.orbis.MsgCreateNodeInfo + (*MsgCreateNodeInfoResponse)(nil), // 17: sourcehub.orbis.MsgCreateNodeInfoResponse + (*MsgUpdateNodeInfo)(nil), // 18: sourcehub.orbis.MsgUpdateNodeInfo + (*MsgUpdateNodeInfoResponse)(nil), // 19: sourcehub.orbis.MsgUpdateNodeInfoResponse + (*Params)(nil), // 20: sourcehub.orbis.Params +} +var file_sourcehub_orbis_tx_proto_depIdxs = []int32{ + 20, // 0: sourcehub.orbis.MsgUpdateParams.params:type_name -> sourcehub.orbis.Params + 0, // 1: sourcehub.orbis.Msg.UpdateParams:input_type -> sourcehub.orbis.MsgUpdateParams + 2, // 2: sourcehub.orbis.Msg.CreateRing:input_type -> sourcehub.orbis.MsgCreateRing + 4, // 3: sourcehub.orbis.Msg.FinalizeRing:input_type -> sourcehub.orbis.MsgFinalizeRing + 6, // 4: sourcehub.orbis.Msg.UpdateRingByAcp:input_type -> sourcehub.orbis.MsgUpdateRingByAcp + 8, // 5: sourcehub.orbis.Msg.FinalizeRingReshareByThresholdSignature:input_type -> sourcehub.orbis.MsgFinalizeRingReshareByThresholdSignature + 12, // 6: sourcehub.orbis.Msg.StoreDocument:input_type -> sourcehub.orbis.MsgStoreDocument + 14, // 7: sourcehub.orbis.Msg.StoreKeyDerivation:input_type -> sourcehub.orbis.MsgStoreKeyDerivation + 16, // 8: sourcehub.orbis.Msg.CreateNodeInfo:input_type -> sourcehub.orbis.MsgCreateNodeInfo + 18, // 9: sourcehub.orbis.Msg.UpdateNodeInfo:input_type -> sourcehub.orbis.MsgUpdateNodeInfo + 1, // 10: sourcehub.orbis.Msg.UpdateParams:output_type -> sourcehub.orbis.MsgUpdateParamsResponse + 3, // 11: sourcehub.orbis.Msg.CreateRing:output_type -> sourcehub.orbis.MsgCreateRingResponse + 5, // 12: sourcehub.orbis.Msg.FinalizeRing:output_type -> sourcehub.orbis.MsgFinalizeRingResponse + 7, // 13: sourcehub.orbis.Msg.UpdateRingByAcp:output_type -> sourcehub.orbis.MsgUpdateRingByAcpResponse + 9, // 14: sourcehub.orbis.Msg.FinalizeRingReshareByThresholdSignature:output_type -> sourcehub.orbis.MsgFinalizeRingReshareByThresholdSignatureResponse + 13, // 15: sourcehub.orbis.Msg.StoreDocument:output_type -> sourcehub.orbis.MsgStoreDocumentResponse + 15, // 16: sourcehub.orbis.Msg.StoreKeyDerivation:output_type -> sourcehub.orbis.MsgStoreKeyDerivationResponse + 17, // 17: sourcehub.orbis.Msg.CreateNodeInfo:output_type -> sourcehub.orbis.MsgCreateNodeInfoResponse + 19, // 18: sourcehub.orbis.Msg.UpdateNodeInfo:output_type -> sourcehub.orbis.MsgUpdateNodeInfoResponse + 10, // [10:19] is the sub-list for method output_type + 1, // [1:10] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_sourcehub_orbis_tx_proto_init() } +func file_sourcehub_orbis_tx_proto_init() { + if File_sourcehub_orbis_tx_proto != nil { + return + } + file_sourcehub_orbis_params_proto_init() + file_sourcehub_orbis_tx_proto_msgTypes[2].OneofWrappers = []any{} + file_sourcehub_orbis_tx_proto_msgTypes[6].OneofWrappers = []any{} + file_sourcehub_orbis_tx_proto_msgTypes[11].OneofWrappers = []any{} + file_sourcehub_orbis_tx_proto_msgTypes[12].OneofWrappers = []any{} + file_sourcehub_orbis_tx_proto_msgTypes[18].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_sourcehub_orbis_tx_proto_rawDesc), len(file_sourcehub_orbis_tx_proto_rawDesc)), + NumEnums: 0, + NumMessages: 20, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_sourcehub_orbis_tx_proto_goTypes, + DependencyIndexes: file_sourcehub_orbis_tx_proto_depIdxs, + MessageInfos: file_sourcehub_orbis_tx_proto_msgTypes, + }.Build() + File_sourcehub_orbis_tx_proto = out.File + file_sourcehub_orbis_tx_proto_goTypes = nil + file_sourcehub_orbis_tx_proto_depIdxs = nil +} diff --git a/api/sourcehub/orbis/tx_grpc.pb.go b/api/sourcehub/orbis/tx_grpc.pb.go new file mode 100644 index 00000000..dd5dbef3 --- /dev/null +++ b/api/sourcehub/orbis/tx_grpc.pb.go @@ -0,0 +1,431 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc (unknown) +// source: sourcehub/orbis/tx.proto + +package orbis + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Msg_UpdateParams_FullMethodName = "/sourcehub.orbis.Msg/UpdateParams" + Msg_CreateRing_FullMethodName = "/sourcehub.orbis.Msg/CreateRing" + Msg_FinalizeRing_FullMethodName = "/sourcehub.orbis.Msg/FinalizeRing" + Msg_UpdateRingByAcp_FullMethodName = "/sourcehub.orbis.Msg/UpdateRingByAcp" + Msg_FinalizeRingReshareByThresholdSignature_FullMethodName = "/sourcehub.orbis.Msg/FinalizeRingReshareByThresholdSignature" + Msg_StoreDocument_FullMethodName = "/sourcehub.orbis.Msg/StoreDocument" + Msg_StoreKeyDerivation_FullMethodName = "/sourcehub.orbis.Msg/StoreKeyDerivation" + Msg_CreateNodeInfo_FullMethodName = "/sourcehub.orbis.Msg/CreateNodeInfo" + Msg_UpdateNodeInfo_FullMethodName = "/sourcehub.orbis.Msg/UpdateNodeInfo" +) + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Msg defines the Msg service. +type MsgClient interface { + // UpdateParams defines a governance operation for updating module parameters. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + CreateRing(ctx context.Context, in *MsgCreateRing, opts ...grpc.CallOption) (*MsgCreateRingResponse, error) + FinalizeRing(ctx context.Context, in *MsgFinalizeRing, opts ...grpc.CallOption) (*MsgFinalizeRingResponse, error) + UpdateRingByAcp(ctx context.Context, in *MsgUpdateRingByAcp, opts ...grpc.CallOption) (*MsgUpdateRingByAcpResponse, error) + FinalizeRingReshareByThresholdSignature(ctx context.Context, in *MsgFinalizeRingReshareByThresholdSignature, opts ...grpc.CallOption) (*MsgFinalizeRingReshareByThresholdSignatureResponse, error) + StoreDocument(ctx context.Context, in *MsgStoreDocument, opts ...grpc.CallOption) (*MsgStoreDocumentResponse, error) + StoreKeyDerivation(ctx context.Context, in *MsgStoreKeyDerivation, opts ...grpc.CallOption) (*MsgStoreKeyDerivationResponse, error) + CreateNodeInfo(ctx context.Context, in *MsgCreateNodeInfo, opts ...grpc.CallOption) (*MsgCreateNodeInfoResponse, error) + UpdateNodeInfo(ctx context.Context, in *MsgUpdateNodeInfo, opts ...grpc.CallOption) (*MsgUpdateNodeInfoResponse, error) +} + +type msgClient struct { + cc grpc.ClientConnInterface +} + +func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CreateRing(ctx context.Context, in *MsgCreateRing, opts ...grpc.CallOption) (*MsgCreateRingResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgCreateRingResponse) + err := c.cc.Invoke(ctx, Msg_CreateRing_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) FinalizeRing(ctx context.Context, in *MsgFinalizeRing, opts ...grpc.CallOption) (*MsgFinalizeRingResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgFinalizeRingResponse) + err := c.cc.Invoke(ctx, Msg_FinalizeRing_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateRingByAcp(ctx context.Context, in *MsgUpdateRingByAcp, opts ...grpc.CallOption) (*MsgUpdateRingByAcpResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgUpdateRingByAcpResponse) + err := c.cc.Invoke(ctx, Msg_UpdateRingByAcp_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) FinalizeRingReshareByThresholdSignature(ctx context.Context, in *MsgFinalizeRingReshareByThresholdSignature, opts ...grpc.CallOption) (*MsgFinalizeRingReshareByThresholdSignatureResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgFinalizeRingReshareByThresholdSignatureResponse) + err := c.cc.Invoke(ctx, Msg_FinalizeRingReshareByThresholdSignature_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) StoreDocument(ctx context.Context, in *MsgStoreDocument, opts ...grpc.CallOption) (*MsgStoreDocumentResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgStoreDocumentResponse) + err := c.cc.Invoke(ctx, Msg_StoreDocument_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) StoreKeyDerivation(ctx context.Context, in *MsgStoreKeyDerivation, opts ...grpc.CallOption) (*MsgStoreKeyDerivationResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgStoreKeyDerivationResponse) + err := c.cc.Invoke(ctx, Msg_StoreKeyDerivation_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CreateNodeInfo(ctx context.Context, in *MsgCreateNodeInfo, opts ...grpc.CallOption) (*MsgCreateNodeInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgCreateNodeInfoResponse) + err := c.cc.Invoke(ctx, Msg_CreateNodeInfo_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateNodeInfo(ctx context.Context, in *MsgUpdateNodeInfo, opts ...grpc.CallOption) (*MsgUpdateNodeInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MsgUpdateNodeInfoResponse) + err := c.cc.Invoke(ctx, Msg_UpdateNodeInfo_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +// All implementations must embed UnimplementedMsgServer +// for forward compatibility. +// +// Msg defines the Msg service. +type MsgServer interface { + // UpdateParams defines a governance operation for updating module parameters. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + CreateRing(context.Context, *MsgCreateRing) (*MsgCreateRingResponse, error) + FinalizeRing(context.Context, *MsgFinalizeRing) (*MsgFinalizeRingResponse, error) + UpdateRingByAcp(context.Context, *MsgUpdateRingByAcp) (*MsgUpdateRingByAcpResponse, error) + FinalizeRingReshareByThresholdSignature(context.Context, *MsgFinalizeRingReshareByThresholdSignature) (*MsgFinalizeRingReshareByThresholdSignatureResponse, error) + StoreDocument(context.Context, *MsgStoreDocument) (*MsgStoreDocumentResponse, error) + StoreKeyDerivation(context.Context, *MsgStoreKeyDerivation) (*MsgStoreKeyDerivationResponse, error) + CreateNodeInfo(context.Context, *MsgCreateNodeInfo) (*MsgCreateNodeInfoResponse, error) + UpdateNodeInfo(context.Context, *MsgUpdateNodeInfo) (*MsgUpdateNodeInfoResponse, error) + mustEmbedUnimplementedMsgServer() +} + +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} + +func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (UnimplementedMsgServer) CreateRing(context.Context, *MsgCreateRing) (*MsgCreateRingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateRing not implemented") +} +func (UnimplementedMsgServer) FinalizeRing(context.Context, *MsgFinalizeRing) (*MsgFinalizeRingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FinalizeRing not implemented") +} +func (UnimplementedMsgServer) UpdateRingByAcp(context.Context, *MsgUpdateRingByAcp) (*MsgUpdateRingByAcpResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateRingByAcp not implemented") +} +func (UnimplementedMsgServer) FinalizeRingReshareByThresholdSignature(context.Context, *MsgFinalizeRingReshareByThresholdSignature) (*MsgFinalizeRingReshareByThresholdSignatureResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FinalizeRingReshareByThresholdSignature not implemented") +} +func (UnimplementedMsgServer) StoreDocument(context.Context, *MsgStoreDocument) (*MsgStoreDocumentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StoreDocument not implemented") +} +func (UnimplementedMsgServer) StoreKeyDerivation(context.Context, *MsgStoreKeyDerivation) (*MsgStoreKeyDerivationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StoreKeyDerivation not implemented") +} +func (UnimplementedMsgServer) CreateNodeInfo(context.Context, *MsgCreateNodeInfo) (*MsgCreateNodeInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateNodeInfo not implemented") +} +func (UnimplementedMsgServer) UpdateNodeInfo(context.Context, *MsgUpdateNodeInfo) (*MsgUpdateNodeInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateNodeInfo not implemented") +} +func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} + +// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MsgServer will +// result in compilation errors. +type UnsafeMsgServer interface { + mustEmbedUnimplementedMsgServer() +} + +func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Msg_ServiceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateParams_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CreateRing_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateRing) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateRing(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_CreateRing_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateRing(ctx, req.(*MsgCreateRing)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_FinalizeRing_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgFinalizeRing) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).FinalizeRing(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_FinalizeRing_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).FinalizeRing(ctx, req.(*MsgFinalizeRing)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateRingByAcp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateRingByAcp) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateRingByAcp(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateRingByAcp_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateRingByAcp(ctx, req.(*MsgUpdateRingByAcp)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_FinalizeRingReshareByThresholdSignature_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgFinalizeRingReshareByThresholdSignature) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).FinalizeRingReshareByThresholdSignature(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_FinalizeRingReshareByThresholdSignature_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).FinalizeRingReshareByThresholdSignature(ctx, req.(*MsgFinalizeRingReshareByThresholdSignature)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_StoreDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgStoreDocument) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).StoreDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_StoreDocument_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).StoreDocument(ctx, req.(*MsgStoreDocument)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_StoreKeyDerivation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgStoreKeyDerivation) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).StoreKeyDerivation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_StoreKeyDerivation_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).StoreKeyDerivation(ctx, req.(*MsgStoreKeyDerivation)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CreateNodeInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateNodeInfo) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateNodeInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_CreateNodeInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateNodeInfo(ctx, req.(*MsgCreateNodeInfo)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateNodeInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateNodeInfo) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateNodeInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_UpdateNodeInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateNodeInfo(ctx, req.(*MsgUpdateNodeInfo)) + } + return interceptor(ctx, in, info, handler) +} + +// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Msg_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "sourcehub.orbis.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "CreateRing", + Handler: _Msg_CreateRing_Handler, + }, + { + MethodName: "FinalizeRing", + Handler: _Msg_FinalizeRing_Handler, + }, + { + MethodName: "UpdateRingByAcp", + Handler: _Msg_UpdateRingByAcp_Handler, + }, + { + MethodName: "FinalizeRingReshareByThresholdSignature", + Handler: _Msg_FinalizeRingReshareByThresholdSignature_Handler, + }, + { + MethodName: "StoreDocument", + Handler: _Msg_StoreDocument_Handler, + }, + { + MethodName: "StoreKeyDerivation", + Handler: _Msg_StoreKeyDerivation_Handler, + }, + { + MethodName: "CreateNodeInfo", + Handler: _Msg_CreateNodeInfo_Handler, + }, + { + MethodName: "UpdateNodeInfo", + Handler: _Msg_UpdateNodeInfo_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "sourcehub/orbis/tx.proto", +} diff --git a/app/app.go b/app/app.go index 91b787dd..dba23c24 100644 --- a/app/app.go +++ b/app/app.go @@ -73,6 +73,7 @@ import ( epochstypes "github.com/sourcenetwork/sourcehub/x/epochs/types" feegrantkeeper "github.com/sourcenetwork/sourcehub/x/feegrant/keeper" hubkeeper "github.com/sourcenetwork/sourcehub/x/hub/keeper" + orbiskeeper "github.com/sourcenetwork/sourcehub/x/orbis/keeper" tierkeeper "github.com/sourcenetwork/sourcehub/x/tier/keeper" tiertypes "github.com/sourcenetwork/sourcehub/x/tier/types" @@ -133,6 +134,7 @@ type App struct { HubKeeper *hubkeeper.Keeper AcpKeeper *acpkeeper.Keeper + OrbisKeeper *orbiskeeper.Keeper BulletinKeeper *bulletinkeeper.Keeper EpochsKeeper *epochskeeper.Keeper TierKeeper *tierkeeper.Keeper @@ -262,6 +264,7 @@ func New( &app.CircuitBreakerKeeper, &app.HubKeeper, &app.AcpKeeper, + &app.OrbisKeeper, &app.BulletinKeeper, &app.EpochsKeeper, &app.TierKeeper, diff --git a/app/app_config.go b/app/app_config.go index 32a16653..72c1b1ff 100644 --- a/app/app_config.go +++ b/app/app_config.go @@ -72,6 +72,7 @@ import ( acpmodulev1 "github.com/sourcenetwork/sourcehub/api/sourcehub/acp/module" bulletinmodulev1 "github.com/sourcenetwork/sourcehub/api/sourcehub/bulletin/module" hubmodulev1 "github.com/sourcenetwork/sourcehub/api/sourcehub/hub/module" + orbismodulev1 "github.com/sourcenetwork/sourcehub/api/sourcehub/orbis/module" tiermodulev1 "github.com/sourcenetwork/sourcehub/api/sourcehub/tier/module/v1beta1" _ "github.com/sourcenetwork/sourcehub/x/acp/module" // import for side-effects acptypes "github.com/sourcenetwork/sourcehub/x/acp/types" @@ -81,6 +82,8 @@ import ( epochstypes "github.com/sourcenetwork/sourcehub/x/epochs/types" _ "github.com/sourcenetwork/sourcehub/x/hub/module" hubmoduletypes "github.com/sourcenetwork/sourcehub/x/hub/types" + _ "github.com/sourcenetwork/sourcehub/x/orbis/module" // import for side-effects + orbistypes "github.com/sourcenetwork/sourcehub/x/orbis/types" _ "github.com/sourcenetwork/sourcehub/x/tier/module" tiertypes "github.com/sourcenetwork/sourcehub/x/tier/types" ) @@ -120,6 +123,7 @@ var ( // chain modules hubmoduletypes.ModuleName, acptypes.ModuleName, + orbistypes.ModuleName, bulletintypes.ModuleName, epochstypes.ModuleName, tiertypes.ModuleName, @@ -325,6 +329,10 @@ var ( Name: acptypes.ModuleName, Config: appconfig.WrapAny(&acpmodulev1.Module{}), }, + { + Name: orbistypes.ModuleName, + Config: appconfig.WrapAny(&orbismodulev1.Module{}), + }, { Name: bulletintypes.ModuleName, Config: appconfig.WrapAny(&bulletinmodulev1.Module{}), diff --git a/app/lanes/priority_lane.go b/app/lanes/priority_lane.go index a0a677a6..15432dc9 100644 --- a/app/lanes/priority_lane.go +++ b/app/lanes/priority_lane.go @@ -82,6 +82,11 @@ func getPriorityGroup(tx sdk.Tx) string { if minPriority > "2" { minPriority = "2" } + case strings.HasPrefix(msgType, "/sourcehub.orbis."): + // Reduce minPriority to 1 if orbis module message found + if minPriority > "1" { + minPriority = "1" + } case strings.HasPrefix(msgType, "/sourcehub.bulletin."): // Reduce minPriority to 1 if bulletin module message found if minPriority > "1" { diff --git a/go.mod b/go.mod index 1c3ca5da..7d48b7c9 100644 --- a/go.mod +++ b/go.mod @@ -34,6 +34,7 @@ require ( github.com/cosmos/ibc-go/v10 v10.1.1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 + github.com/docker/docker v28.5.2+incompatible github.com/go-jose/go-jose/v3 v3.0.5 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 @@ -185,7 +186,6 @@ require ( github.com/distribution/reference v0.6.0 // indirect github.com/docker/cli v29.2.0+incompatible // indirect github.com/docker/distribution v2.8.3+incompatible // indirect - github.com/docker/docker v28.5.2+incompatible // indirect github.com/docker/docker-credential-helpers v0.9.3 // indirect github.com/docker/go-connections v0.6.0 // indirect github.com/docker/go-units v0.5.0 // indirect diff --git a/proto/buf.gen.orbis.optional.yaml b/proto/buf.gen.orbis.optional.yaml new file mode 100644 index 00000000..2ec30a91 --- /dev/null +++ b/proto/buf.gen.orbis.optional.yaml @@ -0,0 +1,22 @@ +# Generates API Go types for Orbis protos that use proto3 optional scalars. +# protoc-gen-go-pulsar v1.0.0-beta.5 emits invalid fast-reflection code for +# these files, so make proto excludes them from Pulsar and runs this template. +version: v2 +managed: + enabled: true + override: + - file_option: go_package_prefix + value: cosmossdk.io/api + disable: + - module: buf.build/googleapis/googleapis + - module: buf.build/cosmos/gogo-proto + - module: buf.build/cosmos/cosmos-proto + - module: buf.build/sourcenetwork/acp-core +plugins: + - local: ["go", "run", "google.golang.org/protobuf/cmd/protoc-gen-go"] + out: ./api + opt: paths=source_relative + + - local: protoc-gen-go-grpc + out: ./api + opt: paths=source_relative diff --git a/proto/buf.gen.pulsar.yaml b/proto/buf.gen.pulsar.yaml index f1cf031e..36d3e86e 100644 --- a/proto/buf.gen.pulsar.yaml +++ b/proto/buf.gen.pulsar.yaml @@ -16,13 +16,13 @@ managed: plugins: - name: go-pulsar out: ./api - opt: - - paths=source_relative - - Msourcenetwork/acp_core/relationship.proto=github.com/sourcenetwork/acp_core/pkg/pulsar/types - - Msourcenetwork/acp_core/policy_short.proto=github.com/sourcenetwork/acp_core/pkg/pulsar/types - - Msourcenetwork/acp_core/policy.proto=github.com/sourcenetwork/acp_core/pkg/pulsar/types - - Msourcenetwork/acp_core/relationship_selector.proto=github.com/sourcenetwork/acp_core/pkg/pulsar/types - - Msourcenetwork/acp_core/request.proto=github.com/sourcenetwork/acp_core/pkg/pulsar/types + opt: + - paths=source_relative + - Msourcenetwork/acp_core/relationship.proto=github.com/sourcenetwork/acp_core/pkg/pulsar/types + - Msourcenetwork/acp_core/policy_short.proto=github.com/sourcenetwork/acp_core/pkg/pulsar/types + - Msourcenetwork/acp_core/policy.proto=github.com/sourcenetwork/acp_core/pkg/pulsar/types + - Msourcenetwork/acp_core/relationship_selector.proto=github.com/sourcenetwork/acp_core/pkg/pulsar/types + - Msourcenetwork/acp_core/request.proto=github.com/sourcenetwork/acp_core/pkg/pulsar/types - name: go-grpc out: ./api diff --git a/proto/sourcehub/bulletin/tx.proto b/proto/sourcehub/bulletin/tx.proto index de012266..a53dee30 100644 --- a/proto/sourcehub/bulletin/tx.proto +++ b/proto/sourcehub/bulletin/tx.proto @@ -6,8 +6,8 @@ import "amino/amino.proto"; import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; -import "sourcehub/bulletin/params.proto"; import "sourcehub/bulletin/namespace.proto"; +import "sourcehub/bulletin/params.proto"; option go_package = "github.com/sourcenetwork/sourcehub/x/bulletin/types"; @@ -19,8 +19,6 @@ service Msg { // parameters. The authority defaults to the x/gov module account. rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); rpc CreatePost(MsgCreatePost) returns (MsgCreatePostResponse); - rpc UpdateRingPostByAcp(MsgUpdateRingPostByAcp) returns (MsgUpdateRingPostByAcpResponse); - rpc UpdateRingPostByThresholdSignature(MsgUpdateRingPostByThresholdSignature) returns (MsgUpdateRingPostByThresholdSignatureResponse); rpc RegisterNamespace(MsgRegisterNamespace) returns (MsgRegisterNamespaceResponse); rpc AddCollaborator(MsgAddCollaborator) returns (MsgAddCollaboratorResponse); rpc RemoveCollaborator(MsgRemoveCollaborator) returns (MsgRemoveCollaboratorResponse); @@ -57,42 +55,6 @@ message MsgCreatePost { message MsgCreatePostResponse {} -message MsgUpdateRingPostByAcp { - option (cosmos.msg.v1.signer) = "creator"; - string creator = 1; - string namespace = 2; - string post_id = 3; - string artifact = 4; - repeated string new_peer_ids = 5; - optional uint32 new_threshold = 6; - optional uint64 pss_interval = 7; -} - -message MsgUpdateRingPostByAcpResponse {} - -message MsgUpdateRingPostByThresholdSignature { - option (cosmos.msg.v1.signer) = "creator"; - string creator = 1; - string namespace = 2; - string post_id = 3; - string artifact = 4; - string signature_scheme = 5; - bytes signature = 6; -} - -message MsgUpdateRingPostByThresholdSignatureResponse {} - -message RingReshareFinalizeSignDoc { - string domain = 1; - string chain_id = 2; - string namespace = 3; - string post_id = 4; - string ring_pk = 5; - bytes current_payload_sha256 = 6; - bytes finalized_payload_sha256 = 7; - uint64 block_number_nonce = 8; -} - message MsgRegisterNamespace { option (cosmos.msg.v1.signer) = "creator"; string creator = 1; diff --git a/proto/sourcehub/orbis/document.proto b/proto/sourcehub/orbis/document.proto new file mode 100644 index 00000000..823fc83c --- /dev/null +++ b/proto/sourcehub/orbis/document.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; +package sourcehub.orbis; + +option go_package = "github.com/sourcenetwork/sourcehub/x/orbis/types"; + +// Document stores an encrypted Orbis document and its policy binding metadata. +message Document { + string id = 1; + string creator_did = 2; + string ring_id = 3; + string document = 4; + string proof = 5; + string policy_id = 6; + string resource = 7; + string permission = 8; + // Absent means no tier. + optional string tier = 9; + // Absent means no timestamp. + optional uint64 timestamp = 10; +} diff --git a/proto/sourcehub/orbis/events.proto b/proto/sourcehub/orbis/events.proto new file mode 100644 index 00000000..4a4ea9d2 --- /dev/null +++ b/proto/sourcehub/orbis/events.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; + +package sourcehub.orbis; + +option go_package = "github.com/sourcenetwork/sourcehub/x/orbis/types"; + +// EventRingCreated is emitted when a ring is created. +message EventRingCreated { + string ring_id = 1; + string creator_did = 2; +} + +// EventRingUpdated is emitted when a ring is updated in place. +message EventRingUpdated { + string ring_id = 1; + string updater_did = 2; +} + +// EventDocumentStored is emitted when an encrypted document is stored. +message EventDocumentStored { + string document_id = 1; + string creator_did = 2; +} + +// EventKeyDerivationStored is emitted when a key derivation is stored. +message EventKeyDerivationStored { + string key_derivation_id = 1; + string creator_did = 2; +} + +// EventNodeInfoCreated is emitted when a node info record is created. +message EventNodeInfoCreated { + string peer_id = 1; + string controller_key = 2; +} + +// EventNodeInfoUpdated is emitted when a node info record is updated. +message EventNodeInfoUpdated { + string peer_id = 1; + string controller_key = 2; +} + +// EventRingDeleted is emitted when a ring is removed from state. +message EventRingDeleted { + string ring_id = 1; + string reason = 2; +} diff --git a/proto/sourcehub/orbis/genesis.proto b/proto/sourcehub/orbis/genesis.proto new file mode 100644 index 00000000..77553e0a --- /dev/null +++ b/proto/sourcehub/orbis/genesis.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; +package sourcehub.orbis; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; +import "sourcehub/orbis/document.proto"; +import "sourcehub/orbis/key_derivation.proto"; +import "sourcehub/orbis/node_info.proto"; +import "sourcehub/orbis/params.proto"; +import "sourcehub/orbis/ring.proto"; + +option go_package = "github.com/sourcenetwork/sourcehub/x/orbis/types"; + +// GenesisState defines the orbis module's genesis state. +message GenesisState { + Params params = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + repeated Ring rings = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + repeated Document documents = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + repeated KeyDerivation key_derivations = 4 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + repeated NodeInfoEntry node_infos = 5 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} diff --git a/proto/sourcehub/orbis/key_derivation.proto b/proto/sourcehub/orbis/key_derivation.proto new file mode 100644 index 00000000..2d6c2ca0 --- /dev/null +++ b/proto/sourcehub/orbis/key_derivation.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package sourcehub.orbis; + +option go_package = "github.com/sourcenetwork/sourcehub/x/orbis/types"; + +// KeyDerivation stores a signing derivation and its policy binding metadata. +message KeyDerivation { + string id = 1; + string creator_did = 2; + string ring_id = 3; + string derivation = 4; + string policy_id = 5; + string resource = 6; + string permission = 7; +} diff --git a/proto/sourcehub/orbis/module/module.proto b/proto/sourcehub/orbis/module/module.proto new file mode 100644 index 00000000..14312226 --- /dev/null +++ b/proto/sourcehub/orbis/module/module.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package sourcehub.orbis.module; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object for the module. +message Module { + option (cosmos.app.v1alpha1.module) = {go_import: "github.com/sourcenetwork/sourcehub/x/orbis"}; + + // authority defines the custom module authority. If not set, defaults to the governance module. + string authority = 1; +} diff --git a/proto/sourcehub/orbis/node_info.proto b/proto/sourcehub/orbis/node_info.proto new file mode 100644 index 00000000..b72d5a03 --- /dev/null +++ b/proto/sourcehub/orbis/node_info.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package sourcehub.orbis; + +option go_package = "github.com/sourcenetwork/sourcehub/x/orbis/types"; + +// NodeInfo stores access-control metadata for a node participating in Orbis rings. +message NodeInfo { + string peer_id = 1; + string controller_key = 2; + repeated string whitelisted_policy_ids = 3; + repeated string whitelisted_ring_ids = 4; +} + +// NodeInfoEntry pairs a node_key with its NodeInfo for genesis export/import. +message NodeInfoEntry { + string node_key = 1; + NodeInfo node_info = 2; +} diff --git a/proto/sourcehub/orbis/params.proto b/proto/sourcehub/orbis/params.proto new file mode 100644 index 00000000..21efbffc --- /dev/null +++ b/proto/sourcehub/orbis/params.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package sourcehub.orbis; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/sourcenetwork/sourcehub/x/orbis/types"; + +// Params defines the parameters for the module. +message Params { + option (amino.name) = "sourcehub/x/orbis/Params"; + option (gogoproto.equal) = true; +} diff --git a/proto/sourcehub/orbis/query.proto b/proto/sourcehub/orbis/query.proto new file mode 100644 index 00000000..fb2630e8 --- /dev/null +++ b/proto/sourcehub/orbis/query.proto @@ -0,0 +1,137 @@ +syntax = "proto3"; + +package sourcehub.orbis; + +import "amino/amino.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "sourcehub/orbis/document.proto"; +import "sourcehub/orbis/key_derivation.proto"; +import "sourcehub/orbis/node_info.proto"; +import "sourcehub/orbis/params.proto"; +import "sourcehub/orbis/ring.proto"; + +option go_package = "github.com/sourcenetwork/sourcehub/x/orbis/types"; + +// Query defines the gRPC querier service. +service Query { + // Parameters queries the parameters of the module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/sourcenetwork/sourcehub/orbis/params"; + } + + // Ring queries a ring by id. + rpc Ring(QueryRingRequest) returns (QueryRingResponse) { + option (google.api.http).get = "/sourcenetwork/sourcehub/orbis/ring/{id}"; + } + + // Rings queries rings. + rpc Rings(QueryRingsRequest) returns (QueryRingsResponse) { + option (google.api.http).get = "/sourcenetwork/sourcehub/orbis/rings"; + } + + // Document queries an encrypted document by id. + rpc Document(QueryDocumentRequest) returns (QueryDocumentResponse) { + option (google.api.http).get = "/sourcenetwork/sourcehub/orbis/document/{id}"; + } + + // Documents queries encrypted documents. + rpc Documents(QueryDocumentsRequest) returns (QueryDocumentsResponse) { + option (google.api.http).get = "/sourcenetwork/sourcehub/orbis/documents"; + } + + // KeyDerivation queries a key derivation by id. + rpc KeyDerivation(QueryKeyDerivationRequest) returns (QueryKeyDerivationResponse) { + option (google.api.http).get = "/sourcenetwork/sourcehub/orbis/key_derivation/{id}"; + } + + // KeyDerivations queries key derivations. + rpc KeyDerivations(QueryKeyDerivationsRequest) returns (QueryKeyDerivationsResponse) { + option (google.api.http).get = "/sourcenetwork/sourcehub/orbis/key_derivations"; + } + + // NodeInfo queries node info by node key. + rpc NodeInfo(QueryNodeInfoRequest) returns (QueryNodeInfoResponse) { + option (google.api.http).get = "/sourcenetwork/sourcehub/orbis/node_info/{node_key}"; + } +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + Params params = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +message QueryRingRequest { + string id = 1; +} + +message QueryRingResponse { + Ring ring = 1; +} + +message QueryRingsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryRingsResponse { + repeated Ring rings = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryDocumentRequest { + string id = 1; +} + +message QueryDocumentResponse { + Document document = 1; +} + +message QueryDocumentsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryDocumentsResponse { + repeated Document documents = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryKeyDerivationRequest { + string id = 1; +} + +message QueryKeyDerivationResponse { + KeyDerivation key_derivation = 1; +} + +message QueryKeyDerivationsRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryKeyDerivationsResponse { + repeated KeyDerivation key_derivations = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryNodeInfoRequest { + string node_key = 1; +} + +message QueryNodeInfoResponse { + NodeInfo node_info = 1; +} diff --git a/proto/sourcehub/orbis/ring.proto b/proto/sourcehub/orbis/ring.proto new file mode 100644 index 00000000..959d4d24 --- /dev/null +++ b/proto/sourcehub/orbis/ring.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package sourcehub.orbis; + +option go_package = "github.com/sourcenetwork/sourcehub/x/orbis/types"; + +// Ring stores the active and pending committee metadata for an Orbis ring. +message Ring { + string id = 1; + string creator_did = 2; + string ring_pk = 3; + repeated string peer_node_keys = 4; + uint32 threshold = 5; + repeated string new_peer_node_keys = 6; + // Absent means no pending threshold update. + optional uint32 new_threshold = 7; + // Absent means automatic PSS refresh is disabled. + optional uint64 pss_interval = 8; + uint64 block_number_nonce = 9; + string policy_id = 10; + repeated RingConfirmation confirmations = 11; +} + +// RingConfirmation records a single peer's agreement on the ring public key. +message RingConfirmation { + string node_key = 1; + string ring_pk = 2; +} diff --git a/proto/sourcehub/orbis/tx.proto b/proto/sourcehub/orbis/tx.proto new file mode 100644 index 00000000..b9ad4a0e --- /dev/null +++ b/proto/sourcehub/orbis/tx.proto @@ -0,0 +1,180 @@ +syntax = "proto3"; + +package sourcehub.orbis; + +import "amino/amino.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "sourcehub/orbis/params.proto"; + +option go_package = "github.com/sourcenetwork/sourcehub/x/orbis/types"; + +// Msg defines the Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // UpdateParams defines a governance operation for updating module parameters. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + rpc CreateRing(MsgCreateRing) returns (MsgCreateRingResponse); + rpc FinalizeRing(MsgFinalizeRing) returns (MsgFinalizeRingResponse); + rpc UpdateRingByAcp(MsgUpdateRingByAcp) returns (MsgUpdateRingByAcpResponse); + rpc FinalizeRingReshareByThresholdSignature(MsgFinalizeRingReshareByThresholdSignature) returns (MsgFinalizeRingReshareByThresholdSignatureResponse); + rpc StoreDocument(MsgStoreDocument) returns (MsgStoreDocumentResponse); + rpc StoreKeyDerivation(MsgStoreKeyDerivation) returns (MsgStoreKeyDerivationResponse); + rpc CreateNodeInfo(MsgCreateNodeInfo) returns (MsgCreateNodeInfoResponse); + rpc UpdateNodeInfo(MsgUpdateNodeInfo) returns (MsgUpdateNodeInfoResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "sourcehub/x/orbis/MsgUpdateParams"; + + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + Params params = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; +} + +// MsgUpdateParamsResponse defines the response structure for MsgUpdateParams. +message MsgUpdateParamsResponse {} + +message MsgCreateRing { + option (cosmos.msg.v1.signer) = "creator"; + string creator = 1; + repeated string peer_node_keys = 2; + uint32 threshold = 3; + // Absent means automatic PSS refresh is disabled. + optional uint64 pss_interval = 4; + string policy_id = 5; + // Absent means no nonce. Provide a nonce to disambiguate rings with identical settings. + optional string nonce = 6; +} + +message MsgCreateRingResponse { + string ring_id = 1; +} + +message MsgFinalizeRing { + option (cosmos.msg.v1.signer) = "creator"; + string creator = 1; + string ring_id = 2; + string ring_pk = 3; +} + +message MsgFinalizeRingResponse {} + +message MsgUpdateRingByAcp { + option (cosmos.msg.v1.signer) = "creator"; + string creator = 1; + string ring_id = 2; + repeated string new_peer_node_keys = 3; + // Absent means no pending threshold update. + optional uint32 new_threshold = 4; + // Absent means no PSS refresh interval update. + optional uint64 pss_interval = 5; +} + +message MsgUpdateRingByAcpResponse {} + +message MsgFinalizeRingReshareByThresholdSignature { + option (cosmos.msg.v1.signer) = "creator"; + string creator = 1; + string ring_id = 2; + string signature_scheme = 3; + bytes signature = 4; +} + +message MsgFinalizeRingReshareByThresholdSignatureResponse {} + +message RingReshareFinalizeSignDoc { + string domain = 1; + string chain_id = 2; + string ring_id = 3; + string ring_pk = 4; + bytes current_ring_sha256 = 5; + bytes finalized_ring_sha256 = 6; + uint64 block_number_nonce = 7; +} + +message RingReshareSignState { + string ring_pk = 1; + repeated string peer_node_keys = 2; + uint32 threshold = 3; + repeated string new_peer_node_keys = 4; + optional uint32 new_threshold = 5; + optional uint64 pss_interval = 6; + uint64 block_number_nonce = 7; + string policy_id = 8; +} + +message MsgStoreDocument { + option (cosmos.msg.v1.signer) = "creator"; + string creator = 1; + string ring_id = 2; + string document = 3; + string proof = 4; + string policy_id = 5; + string resource = 6; + string permission = 7; + // Absent means no tier. + optional string tier = 8; + // Absent means no timestamp. + optional uint64 timestamp = 9; +} + +message MsgStoreDocumentResponse { + string document_id = 1; +} + +message MsgStoreKeyDerivation { + option (cosmos.msg.v1.signer) = "creator"; + string creator = 1; + string ring_id = 2; + string derivation = 3; + string policy_id = 4; + string resource = 5; + string permission = 6; +} + +message MsgStoreKeyDerivationResponse { + string key_derivation_id = 1; +} + +message MsgCreateNodeInfo { + option (cosmos.msg.v1.signer) = "creator"; + string creator = 1; + string peer_id = 2; + string controller_key = 3; + repeated string whitelisted_policy_ids = 4; + repeated string whitelisted_ring_ids = 5; +} + +message MsgCreateNodeInfoResponse {} + +// MsgUpdateNodeInfo replaces mutable fields on an existing NodeInfo record. +// The signer must be the current controller_key holder. +// +// IMPORTANT: whitelisted_policy_ids and whitelisted_ring_ids are REPLACED in +// full, not merged. To add a single entry you must re-send the complete desired +// list. Sending an empty repeated field clears the whitelist entirely. +message MsgUpdateNodeInfo { + option (cosmos.msg.v1.signer) = "creator"; + string creator = 1; + string node_key = 2; + // Absent means no peer_id update. + optional string peer_id = 3; + // Replaces the full policy whitelist. Send the complete desired list on every + // update; an empty field clears all whitelisted policies. + repeated string whitelisted_policy_ids = 4; + // Replaces the full ring whitelist. Send the complete desired list on every + // update; an empty field clears all whitelisted rings. + repeated string whitelisted_ring_ids = 5; + // Absent means no controller_key update. + optional string controller_key = 6; +} + +message MsgUpdateNodeInfoResponse {} diff --git a/sdk/listener.go b/sdk/listener.go index 1bd3f332..56ef74b6 100644 --- a/sdk/listener.go +++ b/sdk/listener.go @@ -14,6 +14,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" acptypes "github.com/sourcenetwork/sourcehub/x/acp/types" bulletintypes "github.com/sourcenetwork/sourcehub/x/bulletin/types" + orbistypes "github.com/sourcenetwork/sourcehub/x/orbis/types" tiertypes "github.com/sourcenetwork/sourcehub/x/tier/types" ) @@ -60,6 +61,7 @@ func (l *TxListener) ListenTxs(ctx context.Context) (<-chan Event, <-chan error, registry := cdctypes.NewInterfaceRegistry() acptypes.RegisterInterfaces(registry) bulletintypes.RegisterInterfaces(registry) + orbistypes.RegisterInterfaces(registry) tiertypes.RegisterInterfaces(registry) mapper := func(in rpctypes.ResultEvent) (Event, error) { diff --git a/sdk/msgset.go b/sdk/msgset.go index 5a5ff793..70ddcf68 100644 --- a/sdk/msgset.go +++ b/sdk/msgset.go @@ -3,6 +3,7 @@ package sdk import ( acptypes "github.com/sourcenetwork/sourcehub/x/acp/types" bulletintypes "github.com/sourcenetwork/sourcehub/x/bulletin/types" + orbistypes "github.com/sourcenetwork/sourcehub/x/orbis/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -54,6 +55,24 @@ func (b *MsgSet) WithCreatePost(msg *bulletintypes.MsgCreatePost) Mapper[*bullet return newMapper(idx, &bulletintypes.MsgCreatePostResponse{}) } +// WithCreateRing includes a MsgCreateRing to the Tx. +func (b *MsgSet) WithCreateRing(msg *orbistypes.MsgCreateRing) Mapper[*orbistypes.MsgCreateRingResponse] { + idx := b.addMsg(msg) + return newMapper(idx, &orbistypes.MsgCreateRingResponse{}) +} + +// WithStoreDocument includes a MsgStoreDocument to the Tx. +func (b *MsgSet) WithStoreDocument(msg *orbistypes.MsgStoreDocument) Mapper[*orbistypes.MsgStoreDocumentResponse] { + idx := b.addMsg(msg) + return newMapper(idx, &orbistypes.MsgStoreDocumentResponse{}) +} + +// WithStoreKeyDerivation includes a MsgStoreKeyDerivation to the Tx. +func (b *MsgSet) WithStoreKeyDerivation(msg *orbistypes.MsgStoreKeyDerivation) Mapper[*orbistypes.MsgStoreKeyDerivationResponse] { + idx := b.addMsg(msg) + return newMapper(idx, &orbistypes.MsgStoreKeyDerivationResponse{}) +} + func (b *MsgSet) WithBearerPolicyCmd(msg *acptypes.MsgBearerPolicyCmd) Mapper[*acptypes.MsgBearerPolicyCmdResponse] { idx := b.addMsg(msg) return newMapper(idx, &acptypes.MsgBearerPolicyCmdResponse{}) diff --git a/sdk/sdk.go b/sdk/sdk.go index 21c1e47c..94a31445 100644 --- a/sdk/sdk.go +++ b/sdk/sdk.go @@ -23,6 +23,7 @@ import ( acptypes "github.com/sourcenetwork/sourcehub/x/acp/types" bulletintypes "github.com/sourcenetwork/sourcehub/x/bulletin/types" + orbistypes "github.com/sourcenetwork/sourcehub/x/orbis/types" ) // Opt configures the construction of a Client @@ -156,6 +157,11 @@ func (c *Client) BulletinQueryClient() bulletintypes.QueryClient { return bulletintypes.NewQueryClient(c.conn) } +// OrbisQueryClient returns a Query Client for the Orbis module. +func (c *Client) OrbisQueryClient() orbistypes.QueryClient { + return orbistypes.NewQueryClient(c.conn) +} + // BankQueryClient returns a Query Client for the Bank module func (c *Client) BankQueryClient() banktypes.QueryClient { return banktypes.NewQueryClient(c.conn) diff --git a/testutil/keeper/orbis.go b/testutil/keeper/orbis.go new file mode 100644 index 00000000..296cc80c --- /dev/null +++ b/testutil/keeper/orbis.go @@ -0,0 +1,103 @@ +package keeper + +import ( + "testing" + + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + dbm "github.com/cosmos/cosmos-db" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + "github.com/cosmos/cosmos-sdk/runtime" + sdk "github.com/cosmos/cosmos-sdk/types" + authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" + "github.com/stretchr/testify/require" + + acpkeeper "github.com/sourcenetwork/sourcehub/x/acp/keeper" + acptypes "github.com/sourcenetwork/sourcehub/x/acp/types" + hubtestutil "github.com/sourcenetwork/sourcehub/x/hub/testutil" + "github.com/sourcenetwork/sourcehub/x/orbis/keeper" + "github.com/sourcenetwork/sourcehub/x/orbis/types" +) + +func OrbisKeeper(t testing.TB) (keeper.Keeper, sdk.Context) { + k, _, ctx := OrbisKeeperFull(t) + return k, ctx +} + +// OrbisKeeperFull returns the keeper, the auth account keeper, and the context. +// Use this when tests need to register accounts with known public keys. +func OrbisKeeperFull(t testing.TB) (keeper.Keeper, authkeeper.AccountKeeper, sdk.Context) { + orbisStoreKey := storetypes.NewKVStoreKey(types.StoreKey) + acpStoreKey := storetypes.NewKVStoreKey(acptypes.StoreKey) + authStoreKey := storetypes.NewKVStoreKey(authtypes.StoreKey) + capabilityStoreKey := storetypes.NewKVStoreKey("capkeeper") + capabilityMemStoreKey := storetypes.NewKVStoreKey("capkeepermem") + + db := dbm.NewMemDB() + stateStore := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) + stateStore.MountStoreWithDB(orbisStoreKey, storetypes.StoreTypeDB, db) + stateStore.MountStoreWithDB(acpStoreKey, storetypes.StoreTypeDB, db) + stateStore.MountStoreWithDB(authStoreKey, storetypes.StoreTypeDB, db) + stateStore.MountStoreWithDB(capabilityStoreKey, storetypes.StoreTypeDB, db) + stateStore.MountStoreWithDB(capabilityMemStoreKey, storetypes.StoreTypeDB, db) + require.NoError(t, stateStore.LoadLatestVersion()) + + registry := codectypes.NewInterfaceRegistry() + authtypes.RegisterInterfaces(registry) + cryptocodec.RegisterInterfaces(registry) + + cdc := codec.NewProtoCodec(registry) + authority := authtypes.NewModuleAddress(govtypes.ModuleName) + bech32Prefix := "source" + addressCodec := authcodec.NewBech32Codec(bech32Prefix) + + maccPerms := map[string][]string{ + authtypes.FeeCollectorName: nil, + } + + accountKeeper := authkeeper.NewAccountKeeper( + cdc, + runtime.NewKVStoreService(authStoreKey), + authtypes.ProtoBaseAccount, + maccPerms, + addressCodec, + bech32Prefix, + authority.String(), + ) + + capKeeper := capabilitykeeper.NewKeeper(cdc, capabilityStoreKey, capabilityMemStoreKey) + acpCapKeeper := capKeeper.ScopeToModule(acptypes.ModuleName) + + acpKeeper := acpkeeper.NewKeeper( + cdc, + runtime.NewKVStoreService(acpStoreKey), + log.NewNopLogger(), + authority.String(), + accountKeeper, + &acpCapKeeper, + hubtestutil.NewHubKeeperStub(), + ) + + k := keeper.NewKeeper( + cdc, + runtime.NewKVStoreService(orbisStoreKey), + log.NewNopLogger(), + authority.String(), + accountKeeper, + &acpKeeper, + ) + + ctx := sdk.NewContext(stateStore, cmtproto.Header{}, false, log.NewNopLogger()) + k.SetParams(ctx, types.DefaultParams()) + + return k, accountKeeper, ctx +} diff --git a/x/bulletin/keeper/msg_server.go b/x/bulletin/keeper/msg_server.go index bd41c931..2ae7f50c 100644 --- a/x/bulletin/keeper/msg_server.go +++ b/x/bulletin/keeper/msg_server.go @@ -3,7 +3,6 @@ package keeper import ( "context" "encoding/base64" - "encoding/json" errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" @@ -72,10 +71,12 @@ func (k *Keeper) RegisterNamespace(goCtx context.Context, msg *types.MsgRegister } // CreatePost adds a new post to the specified (existing) namespace. -// Post creation is unrestricted: any valid signer may create a post in any -// registered namespace. Duplicate (namespace, payload) pairs are rejected -// because post_id is derived from them. +// The signer must have permission to create posts in that namespace. func (k *Keeper) CreatePost(goCtx context.Context, msg *types.MsgCreatePost) (*types.MsgCreatePostResponse, error) { + policyId := k.GetPolicyId(goCtx) + if policyId == "" { + return nil, types.ErrInvalidPolicyId + } ctx := sdk.UnwrapSDKContext(goCtx) namespaceId := getNamespaceId(msg.Namespace) @@ -88,6 +89,14 @@ func (k *Keeper) CreatePost(goCtx context.Context, msg *types.MsgCreatePost) (*t return nil, err } + hasPermission, err := hasPermission(goCtx, k, policyId, namespaceId, types.CreatePostPermission, creatorDID, msg.Creator) + if err != nil { + return nil, err + } + if !hasPermission { + return nil, types.ErrInvalidPostCreator + } + postId := types.GeneratePostId(namespaceId, msg.Payload) if existing := k.getPost(goCtx, namespaceId, postId); existing != nil { @@ -116,158 +125,6 @@ func (k *Keeper) CreatePost(goCtx context.Context, msg *types.MsgCreatePost) (*t return &types.MsgCreatePostResponse{}, nil } -// UpdateRingPostByAcp updates the new_peer_ids, new_threshold, and/or -// pss_interval fields of a ring post. The existing post must be a valid ring -// payload containing a policy_id. The caller must hold update_post permission -// in that policy. -func (k *Keeper) UpdateRingPostByAcp(goCtx context.Context, msg *types.MsgUpdateRingPostByAcp) (*types.MsgUpdateRingPostByAcpResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - namespaceId := getNamespaceId(msg.Namespace) - if !k.hasNamespace(goCtx, namespaceId) { - return nil, types.ErrNamespaceNotFound - } - - existing := k.getPost(goCtx, namespaceId, msg.PostId) - if existing == nil { - return nil, types.ErrPostNotFound - } - - ringPayload, err := parseRingPayloadJSON(existing.Payload) - if err != nil { - return nil, err - } - - if ringPayload.PolicyID == nil { - return nil, types.ErrRingPayloadMissingPolicyId - } - policyId := *ringPayload.PolicyID - - updaterDID, err := k.GetAcpKeeper().GetActorDID(ctx, msg.Creator) - if err != nil { - return nil, err - } - - allowed, err := hasPermission(goCtx, k, policyId, namespaceId, types.UpdatePostPermission, updaterDID, msg.Creator) - if err != nil { - return nil, err - } - if !allowed { - return nil, types.ErrInvalidPostUpdater - } - - var newThreshold *uint32 - if msg.XNewThreshold != nil { - v := msg.GetNewThreshold() - newThreshold = &v - } - if err := validateRingPostUpdate(msg.NewPeerIds, newThreshold, ringPayload); err != nil { - return nil, err - } - - if len(msg.NewPeerIds) > 0 { - ringPayload.NewPeerIDs = &msg.NewPeerIds - } - if newThreshold != nil { - ringPayload.NewThreshold = newThreshold - } - if msg.XPssInterval != nil { - v := msg.GetPssInterval() - ringPayload.PSSInterval = &v - } - - updatedPayload, err := json.Marshal(ringPayload) - if err != nil { - return nil, errorsmod.Wrapf(types.ErrInvalidPostPayload, "could not marshal updated ring payload: %s", err) - } - - existing.Payload = updatedPayload - k.SetPost(goCtx, *existing) - - b64Payload := base64.StdEncoding.EncodeToString(existing.Payload) - if err := ctx.EventManager().EmitTypedEvent(&types.EventPostUpdated{ - NamespaceId: namespaceId, - PostId: existing.Id, - UpdaterDid: updaterDID, - Payload: b64Payload, - Artifact: msg.Artifact, - }); err != nil { - return nil, err - } - - return &types.MsgUpdateRingPostByAcpResponse{}, nil -} - -// UpdateRingPostByThresholdSignature finalizes a reshare using only the current -// bulletin payload as state. It moves new_peer_ids/new_threshold into -// peer_ids/threshold, clears the new_* fields, and verifies a threshold -// signature over the canonical transition sign doc against the current -// payload's ring_pk. Once accepted, the stored payload's block_number_nonce is -// set to the current block height. -// This path does not perform the ACP collaborator permission check used by -// UpdatePost. -func (k *Keeper) UpdateRingPostByThresholdSignature( - goCtx context.Context, - msg *types.MsgUpdateRingPostByThresholdSignature, -) (*types.MsgUpdateRingPostByThresholdSignatureResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - namespaceId := getNamespaceId(msg.Namespace) - if !k.hasNamespace(goCtx, namespaceId) { - return nil, types.ErrNamespaceNotFound - } - - existing := k.getPost(goCtx, namespaceId, msg.PostId) - if existing == nil { - return nil, types.ErrPostNotFound - } - - updaterDID, err := k.GetAcpKeeper().GetActorDID(ctx, msg.Creator) - if err != nil { - return nil, err - } - - currentRingPayload, err := parseRingPayloadJSON(existing.Payload) - if err != nil { - return nil, err - } - - signDocFinalizedPayload, err := deriveFinalizedRingPayloadReshare(currentRingPayload) - if err != nil { - return nil, err - } - - signBytes, err := ringReshareFinalizeSignBytes(ctx.ChainID(), msg.Namespace, msg.PostId, existing.Payload, signDocFinalizedPayload, currentRingPayload) - if err != nil { - return nil, err - } - - if err := verifyThresholdSignatureForRingPayloadUpdate(currentRingPayload, signBytes, msg.SignatureScheme, msg.Signature); err != nil { - return nil, err - } - - finalizedPayload, err := finalizeRingPayloadReshare(currentRingPayload, uint64(ctx.BlockHeight())) - if err != nil { - return nil, err - } - - existing.Payload = finalizedPayload - k.SetPost(goCtx, *existing) - - b64Payload := base64.StdEncoding.EncodeToString(existing.Payload) - if err := ctx.EventManager().EmitTypedEvent(&types.EventPostUpdated{ - NamespaceId: namespaceId, - PostId: existing.Id, - UpdaterDid: updaterDID, - Payload: b64Payload, - Artifact: msg.Artifact, - }); err != nil { - return nil, err - } - - return &types.MsgUpdateRingPostByThresholdSignatureResponse{}, nil -} - // AddCollaborator adds a new collaborator to the specified namespace. // The signer must have permission to manage collaborators of that namespace object. func (k *Keeper) AddCollaborator(goCtx context.Context, msg *types.MsgAddCollaborator) (*types.MsgAddCollaboratorResponse, error) { diff --git a/x/bulletin/keeper/msg_server_test.go b/x/bulletin/keeper/msg_server_test.go index 3b09d5d7..b1a4be73 100644 --- a/x/bulletin/keeper/msg_server_test.go +++ b/x/bulletin/keeper/msg_server_test.go @@ -1,794 +1,16 @@ package keeper import ( - "encoding/hex" - "encoding/json" - "fmt" "testing" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/stretchr/testify/require" - blst "github.com/supranational/blst/bindings/go" "github.com/sourcenetwork/sourcehub/x/bulletin/types" ) -func TestMsgUpdateRingPostByAcp_ValidateBasic(t *testing.T) { - k, ctx := setupKeeper(t) - require.NoError(t, k.SetParams(ctx, types.DefaultParams())) - - ownerKey := secp256k1.GenPrivKey().PubKey() - owner := authtypes.NewBaseAccount(sdk.AccAddress(ownerKey.Address()), ownerKey, 1, 1) - k.accountKeeper.SetAccount(ctx, owner) - - cases := []struct { - msg *types.MsgUpdateRingPostByAcp - errMsg string - }{ - {&types.MsgUpdateRingPostByAcp{}, "invalid creator address"}, - {&types.MsgUpdateRingPostByAcp{Creator: owner.Address}, "invalid namespace id"}, - {&types.MsgUpdateRingPostByAcp{Creator: owner.Address, Namespace: "ns1"}, "invalid post id"}, - } - for _, c := range cases { - err := c.msg.ValidateBasic() - require.Error(t, err) - require.Contains(t, err.Error(), c.errMsg) - } -} - -func TestMsgUpdateRingPostByAcp(t *testing.T) { - k, ctx := setupKeeper(t) - require.NoError(t, k.SetParams(ctx, types.DefaultParams())) - - ownerKey := secp256k1.GenPrivKey().PubKey() - owner := authtypes.NewBaseAccount(sdk.AccAddress(ownerKey.Address()), ownerKey, 1, 1) - k.accountKeeper.SetAccount(ctx, owner) - - outsiderKey := secp256k1.GenPrivKey().PubKey() - outsider := authtypes.NewBaseAccount(sdk.AccAddress(outsiderKey.Address()), outsiderKey, 2, 1) - k.accountKeeper.SetAccount(ctx, outsider) - - collabKey := secp256k1.GenPrivKey().PubKey() - collab := authtypes.NewBaseAccount(sdk.AccAddress(collabKey.Address()), collabKey, 3, 1) - k.accountKeeper.SetAccount(ctx, collab) - - setupTestPolicy(t, ctx, k) - - namespace := "ns1" - namespaceId := getNamespaceId(namespace) - - _, err := k.RegisterNamespace(ctx, &types.MsgRegisterNamespace{ - Creator: owner.Address, - Namespace: namespace, - }) - require.NoError(t, err) - - policyId := k.GetPolicyId(ctx) - require.NotEmpty(t, policyId) - - ringPayloadBytes := makeRingPayloadWithPolicy(t, policyId) - _, err = k.CreatePost(ctx, &types.MsgCreatePost{ - Creator: owner.Address, - Namespace: namespace, - Payload: ringPayloadBytes, - }) - require.NoError(t, err) - - postId := types.GeneratePostId(namespaceId, ringPayloadBytes) - - t.Run("namespace not found", func(t *testing.T) { - _, err := k.UpdateRingPostByAcp(ctx, &types.MsgUpdateRingPostByAcp{ - Creator: owner.Address, - Namespace: "does-not-exist", - PostId: postId, - NewPeerIds: []string{"peer2"}, - }) - require.ErrorIs(t, err, types.ErrNamespaceNotFound) - }) - - t.Run("post not found", func(t *testing.T) { - _, err := k.UpdateRingPostByAcp(ctx, &types.MsgUpdateRingPostByAcp{ - Creator: owner.Address, - Namespace: namespace, - PostId: "nonexistent-post-id", - NewPeerIds: []string{"peer2"}, - }) - require.ErrorIs(t, err, types.ErrPostNotFound) - }) - - t.Run("non-ring payload is rejected", func(t *testing.T) { - invalidPostID := "invalid-ring-payload-post" - k.SetPost(ctx, types.Post{ - Id: invalidPostID, - Namespace: namespaceId, - Payload: []byte("not-ring-json"), - }) - _, err := k.UpdateRingPostByAcp(ctx, &types.MsgUpdateRingPostByAcp{ - Creator: owner.Address, - Namespace: namespace, - PostId: invalidPostID, - NewPeerIds: []string{"peer2"}, - }) - require.ErrorIs(t, err, types.ErrInvalidPostPayload) - }) - - t.Run("ring payload without policy_id is rejected", func(t *testing.T) { - noPolicyPostID := "no-policy-id-post" - noPolicyPayload := ringPayloadWithSeed(t, "sourcehub-bulletin-bls-test-seed-0003", []string{"peer1"}, 1, nil, nil) - k.SetPost(ctx, types.Post{ - Id: noPolicyPostID, - Namespace: namespaceId, - Payload: noPolicyPayload, - }) - _, err := k.UpdateRingPostByAcp(ctx, &types.MsgUpdateRingPostByAcp{ - Creator: owner.Address, - Namespace: namespace, - PostId: noPolicyPostID, - NewPeerIds: []string{"peer2"}, - }) - require.ErrorIs(t, err, types.ErrRingPayloadMissingPolicyId) - }) - - t.Run("outsider without permission is rejected", func(t *testing.T) { - _, err := k.UpdateRingPostByAcp(ctx, &types.MsgUpdateRingPostByAcp{ - Creator: outsider.Address, - Namespace: namespace, - PostId: postId, - NewPeerIds: []string{"peer2"}, - }) - require.ErrorIs(t, err, types.ErrInvalidPostUpdater) - - stored := k.getPost(ctx, namespaceId, postId) - require.NotNil(t, stored) - require.Equal(t, ringPayloadBytes, stored.Payload) - }) - - t.Run("collaborator can update new_peer_ids and post_id is preserved", func(t *testing.T) { - _, err := k.AddCollaborator(ctx, &types.MsgAddCollaborator{ - Creator: owner.Address, - Namespace: namespace, - Collaborator: collab.Address, - }) - require.NoError(t, err) - - t.Run("duplicate new_peer_ids are rejected", func(t *testing.T) { - _, err := k.UpdateRingPostByAcp(ctx, &types.MsgUpdateRingPostByAcp{ - Creator: collab.Address, - Namespace: namespace, - PostId: postId, - NewPeerIds: []string{"peer2", "peer2"}, - }) - require.ErrorIs(t, err, types.ErrInvalidPostPayload) - }) - - t.Run("new_threshold of zero is rejected", func(t *testing.T) { - _, err := k.UpdateRingPostByAcp(ctx, &types.MsgUpdateRingPostByAcp{ - Creator: collab.Address, - Namespace: namespace, - PostId: postId, - XNewThreshold: &types.MsgUpdateRingPostByAcp_NewThreshold{NewThreshold: 0}, - }) - require.ErrorIs(t, err, types.ErrInvalidPostPayload) - }) - - _, err = k.UpdateRingPostByAcp(ctx, &types.MsgUpdateRingPostByAcp{ - Creator: collab.Address, - Namespace: namespace, - PostId: postId, - NewPeerIds: []string{"peer2", "peer3"}, - }) - require.NoError(t, err) - - stored := k.getPost(ctx, namespaceId, postId) - require.NotNil(t, stored) - require.Equal(t, postId, stored.Id) - - parsed, err := parseRingPayloadJSON(stored.Payload) - require.NoError(t, err) - require.Equal(t, []string{"peer2", "peer3"}, *parsed.NewPeerIDs) - }) - - t.Run("reshare in progress: changing new_threshold alone is rejected", func(t *testing.T) { - // post currently has new_peer_ids set from the previous test — reshare in progress - _, err = k.UpdateRingPostByAcp(ctx, &types.MsgUpdateRingPostByAcp{ - Creator: collab.Address, - Namespace: namespace, - PostId: postId, - XNewThreshold: &types.MsgUpdateRingPostByAcp_NewThreshold{NewThreshold: 2}, - }) - require.ErrorIs(t, err, types.ErrReshareInProgress) - }) - - t.Run("new_threshold is updated when set alongside new_peer_ids", func(t *testing.T) { - // reset post to original so no reshare is in progress - original := k.getPost(ctx, namespaceId, postId) - original.Payload = ringPayloadBytes - k.SetPost(ctx, *original) - - threshold := uint32(2) - _, err = k.UpdateRingPostByAcp(ctx, &types.MsgUpdateRingPostByAcp{ - Creator: collab.Address, - Namespace: namespace, - PostId: postId, - NewPeerIds: []string{"peer2", "peer3"}, - XNewThreshold: &types.MsgUpdateRingPostByAcp_NewThreshold{NewThreshold: threshold}, - }) - require.NoError(t, err) - - parsed, err := parseRingPayloadJSON(k.getPost(ctx, namespaceId, postId).Payload) - require.NoError(t, err) - require.Equal(t, threshold, *parsed.NewThreshold) - require.Equal(t, []string{"peer2", "peer3"}, *parsed.NewPeerIDs) - }) - - t.Run("pss_interval is updated when provided", func(t *testing.T) { - interval := uint64(100) - _, err = k.UpdateRingPostByAcp(ctx, &types.MsgUpdateRingPostByAcp{ - Creator: collab.Address, - Namespace: namespace, - PostId: postId, - XPssInterval: &types.MsgUpdateRingPostByAcp_PssInterval{PssInterval: interval}, - }) - require.NoError(t, err) - - parsed, err := parseRingPayloadJSON(k.getPost(ctx, namespaceId, postId).Payload) - require.NoError(t, err) - require.Equal(t, interval, *parsed.PSSInterval) - }) - - t.Run("unspecified fields are not changed", func(t *testing.T) { - before, err := parseRingPayloadJSON(k.getPost(ctx, namespaceId, postId).Payload) - require.NoError(t, err) - originalPeerIDs := *before.PeerIDs - originalNewThreshold := *before.NewThreshold - - // pss_interval-only update is allowed even while a reshare is in progress - _, err = k.UpdateRingPostByAcp(ctx, &types.MsgUpdateRingPostByAcp{ - Creator: collab.Address, - Namespace: namespace, - PostId: postId, - XPssInterval: &types.MsgUpdateRingPostByAcp_PssInterval{PssInterval: 200}, - }) - require.NoError(t, err) - - after, err := parseRingPayloadJSON(k.getPost(ctx, namespaceId, postId).Payload) - require.NoError(t, err) - require.Equal(t, originalPeerIDs, *after.PeerIDs) - require.Equal(t, originalNewThreshold, *after.NewThreshold) - }) -} - -func makeRingPayloadWithPolicy(t *testing.T, policyId string) []byte { - t.Helper() - payload := ringPayloadWithSeed(t, "sourcehub-bulletin-bls-test-seed-0001", []string{"peer1"}, 1, nil, nil) - - var raw map[string]interface{} - require.NoError(t, json.Unmarshal(payload, &raw)) - raw["policy_id"] = policyId - out, err := json.Marshal(raw) - require.NoError(t, err) - return out -} - -func TestMsgCreatePost_DoesNotValidateRingPayload(t *testing.T) { - k, ctx := setupKeeper(t) - require.NoError(t, k.SetParams(ctx, types.DefaultParams())) - - ownerKey := secp256k1.GenPrivKey().PubKey() - owner := authtypes.NewBaseAccount(sdk.AccAddress(ownerKey.Address()), ownerKey, 1, 1) - k.accountKeeper.SetAccount(ctx, owner) - - namespace := "orbis/rings/ring1" - - _, err := k.RegisterNamespace(ctx, &types.MsgRegisterNamespace{ - Creator: owner.Address, - Namespace: namespace, - }) - require.NoError(t, err) - - _, err = k.CreatePost(ctx, &types.MsgCreatePost{ - Creator: owner.Address, - Namespace: namespace, - Payload: []byte(`{"ring_pk":"pk","peer_ids":["peer1"]}`), - }) - require.NoError(t, err) -} - - -func TestMsgUpdateRingPostByThresholdSignature_ValidateBasic(t *testing.T) { - k, ctx := setupKeeper(t) - require.NoError(t, k.SetParams(ctx, types.DefaultParams())) - - ownerKey := secp256k1.GenPrivKey().PubKey() - owner := authtypes.NewBaseAccount(sdk.AccAddress(ownerKey.Address()), ownerKey, 1, 1) - k.accountKeeper.SetAccount(ctx, owner) - - validMsg := &types.MsgUpdateRingPostByThresholdSignature{ - Creator: owner.Address, - Namespace: "ns1", - PostId: "post1", - SignatureScheme: ThresholdSignatureSchemeBLS12381G1PKG2SigNUL, - Signature: []byte("signature"), - } - require.NoError(t, validMsg.ValidateBasic()) - - cases := []struct { - msg *types.MsgUpdateRingPostByThresholdSignature - wantErr error - }{ - {&types.MsgUpdateRingPostByThresholdSignature{}, sdkerrors.ErrInvalidAddress}, - {&types.MsgUpdateRingPostByThresholdSignature{Creator: owner.Address}, types.ErrInvalidNamespaceId}, - {&types.MsgUpdateRingPostByThresholdSignature{Creator: owner.Address, Namespace: "ns1"}, types.ErrInvalidPostId}, - {&types.MsgUpdateRingPostByThresholdSignature{Creator: owner.Address, Namespace: "ns1", PostId: "post1"}, types.ErrInvalidSignatureScheme}, - {&types.MsgUpdateRingPostByThresholdSignature{Creator: owner.Address, Namespace: "ns1", PostId: "post1", SignatureScheme: ThresholdSignatureSchemeBLS12381G1PKG2SigNUL}, types.ErrInvalidSignaturePayload}, - } - for _, c := range cases { - err := c.msg.ValidateBasic() - require.ErrorIs(t, err, c.wantErr) - } -} - -func TestUpdateRingPostByThresholdSignature_ValidatesRingPayload(t *testing.T) { - k, ctx := setupKeeper(t) - ctx = ctx.WithChainID("sourcehub-test").WithBlockHeight(101) - require.NoError(t, k.SetParams(ctx, types.DefaultParams())) - - ownerKey := secp256k1.GenPrivKey().PubKey() - owner := authtypes.NewBaseAccount(sdk.AccAddress(ownerKey.Address()), ownerKey, 1, 1) - k.accountKeeper.SetAccount(ctx, owner) - - namespace := "ns1" - namespaceId := getNamespaceId(namespace) - originalPayload := ringPayloadWithSeed( - t, - "sourcehub-bulletin-bls-test-seed-0001", - []string{"peer1"}, - 1, - []string{"peer2"}, - uint32Ptr(2), - ) - - _, err := k.RegisterNamespace(ctx, &types.MsgRegisterNamespace{ - Creator: owner.Address, - Namespace: namespace, - }) - require.NoError(t, err) - - _, err = k.CreatePost(ctx, &types.MsgCreatePost{ - Creator: owner.Address, - Namespace: namespace, - Payload: originalPayload, - }) - require.NoError(t, err) - - postId := types.GeneratePostId(namespaceId, originalPayload) - - invalidCurrentPayloads := [][]byte{ - []byte(`not-json`), - []byte(`{"ring_pk":"pk","peer_ids":["peer1"]}`), - []byte(`{"ring_pk":"pk","peer_ids":["peer1"],"threshold":-1}`), - []byte(`{"ring_pk":"pk","peer_ids":["peer1"],"threshold":1}`), - } - - for i, payload := range invalidCurrentPayloads { - invalidPostID := fmt.Sprintf("invalid-post-%d", i) - k.SetPost(ctx, types.Post{ - Id: invalidPostID, - Namespace: namespaceId, - CreatorDid: owner.Address, - Payload: payload, - }) - - _, err = k.UpdateRingPostByThresholdSignature(ctx, &types.MsgUpdateRingPostByThresholdSignature{ - Creator: owner.Address, - Namespace: namespace, - PostId: invalidPostID, - SignatureScheme: ThresholdSignatureSchemeBLS12381G1PKG2SigNUL, - }) - require.ErrorIs(t, err, types.ErrInvalidPostPayload) - - stored := k.getPost(ctx, namespaceId, invalidPostID) - require.NotNil(t, stored) - require.Equal(t, payload, stored.Payload) - } - - currentRingPayload, err := parseRingPayloadJSON(originalPayload) - require.NoError(t, err) - signDocFinalizedPayload, err := deriveFinalizedRingPayloadReshare(currentRingPayload) - require.NoError(t, err) - finalizedPayload, err := finalizeRingPayloadReshare(currentRingPayload, uint64(ctx.BlockHeight())) - require.NoError(t, err) - signature := signReshareFinalizePayload( - t, - ctx.ChainID(), - namespace, - postId, - originalPayload, - signDocFinalizedPayload, - "sourcehub-bulletin-bls-test-seed-0001", - ) - _, err = k.UpdateRingPostByThresholdSignature(ctx, &types.MsgUpdateRingPostByThresholdSignature{ - Creator: owner.Address, - Namespace: namespace, - PostId: postId, - SignatureScheme: ThresholdSignatureSchemeBLS12381G1PKG2SigNUL, - Signature: signature, - }) - require.NoError(t, err) - - stored := k.getPost(ctx, namespaceId, postId) - require.NotNil(t, stored) - require.Equal(t, finalizedPayload, stored.Payload) -} - -func TestUpdateRingPostByThresholdSignature_VerifiesThresholdSignature(t *testing.T) { - k, ctx := setupKeeper(t) - ctx = ctx.WithChainID("sourcehub-test").WithBlockHeight(202) - require.NoError(t, k.SetParams(ctx, types.DefaultParams())) - - ownerKey := secp256k1.GenPrivKey().PubKey() - owner := authtypes.NewBaseAccount(sdk.AccAddress(ownerKey.Address()), ownerKey, 1, 1) - k.accountKeeper.SetAccount(ctx, owner) - - updaterKey := secp256k1.GenPrivKey().PubKey() - updater := authtypes.NewBaseAccount(sdk.AccAddress(updaterKey.Address()), updaterKey, 2, 1) - k.accountKeeper.SetAccount(ctx, updater) - - namespace := "manual-ns" - namespaceId := getNamespaceId(namespace) - ownerDID, err := k.GetAcpKeeper().GetActorDID(ctx, owner.Address) - require.NoError(t, err) - k.SetNamespace(ctx, types.Namespace{ - Id: namespaceId, - OwnerDid: ownerDID, - Creator: owner.Address, - }) - - originalPayload := ringPayloadWithSeed( - t, - "sourcehub-bulletin-bls-test-seed-0001", - []string{"peer1"}, - 1, - []string{"peer2"}, - uint32Ptr(2), - ) - postId := "post1" - k.SetPost(ctx, types.Post{ - Id: postId, - Namespace: namespaceId, - CreatorDid: ownerDID, - Payload: originalPayload, - }) - require.Empty(t, k.GetPolicyId(ctx)) - - currentRingPayload, err := parseRingPayloadJSON(originalPayload) - require.NoError(t, err) - signDocFinalizedPayload, err := deriveFinalizedRingPayloadReshare(currentRingPayload) - require.NoError(t, err) - finalizedPayload, err := finalizeRingPayloadReshare(currentRingPayload, uint64(ctx.BlockHeight())) - require.NoError(t, err) - signature := signReshareFinalizePayload( - t, - ctx.ChainID(), - namespace, - postId, - originalPayload, - signDocFinalizedPayload, - "sourcehub-bulletin-bls-test-seed-0001", - ) - tamperedSignature := append([]byte(nil), signature...) - tamperedSignature[len(tamperedSignature)-1] ^= 0x01 - attackerSignature := signReshareFinalizePayload( - t, - ctx.ChainID(), - namespace, - postId, - originalPayload, - signDocFinalizedPayload, - "sourcehub-bulletin-bls-test-seed-0002", - ) - - _, err = k.UpdateRingPostByThresholdSignature(ctx, &types.MsgUpdateRingPostByThresholdSignature{ - Creator: updater.Address, - Namespace: namespace, - PostId: postId, - SignatureScheme: ThresholdSignatureSchemeBLS12381G1PKG2SigNUL, - Signature: tamperedSignature, - }) - require.ErrorIs(t, err, types.ErrInvalidThresholdSignature) - - stored := k.getPost(ctx, namespaceId, postId) - require.NotNil(t, stored) - require.Equal(t, originalPayload, stored.Payload) - - _, err = k.UpdateRingPostByThresholdSignature(ctx, &types.MsgUpdateRingPostByThresholdSignature{ - Creator: updater.Address, - Namespace: namespace, - PostId: postId, - SignatureScheme: ThresholdSignatureSchemeBLS12381G1PKG2SigNUL, - Signature: attackerSignature, - }) - require.ErrorIs(t, err, types.ErrInvalidThresholdSignature) - - stored = k.getPost(ctx, namespaceId, postId) - require.NotNil(t, stored) - require.Equal(t, originalPayload, stored.Payload) - - _, err = k.UpdateRingPostByThresholdSignature(ctx, &types.MsgUpdateRingPostByThresholdSignature{ - Creator: updater.Address, - Namespace: namespace, - PostId: postId, - SignatureScheme: "bls12_381", - Signature: signature, - }) - require.ErrorIs(t, err, types.ErrInvalidThresholdSignature) - - stored = k.getPost(ctx, namespaceId, postId) - require.NotNil(t, stored) - require.Equal(t, originalPayload, stored.Payload) - - post2ID := "post2" - k.SetPost(ctx, types.Post{ - Id: post2ID, - Namespace: namespaceId, - CreatorDid: ownerDID, - Payload: originalPayload, - }) - _, err = k.UpdateRingPostByThresholdSignature(ctx, &types.MsgUpdateRingPostByThresholdSignature{ - Creator: updater.Address, - Namespace: namespace, - PostId: post2ID, - SignatureScheme: ThresholdSignatureSchemeBLS12381G1PKG2SigNUL, - Signature: signature, - }) - require.ErrorIs(t, err, types.ErrInvalidThresholdSignature) - - stored = k.getPost(ctx, namespaceId, post2ID) - require.NotNil(t, stored) - require.Equal(t, originalPayload, stored.Payload) - - staleCurrentPayload := ringPayloadWithSeed( - t, - "sourcehub-bulletin-bls-test-seed-0001", - []string{"peer1"}, - 1, - []string{"peer2", "peer4"}, - uint32Ptr(2), - ) - k.SetPost(ctx, types.Post{ - Id: postId, - Namespace: namespaceId, - CreatorDid: ownerDID, - Payload: staleCurrentPayload, - }) - _, err = k.UpdateRingPostByThresholdSignature(ctx, &types.MsgUpdateRingPostByThresholdSignature{ - Creator: updater.Address, - Namespace: namespace, - PostId: postId, - SignatureScheme: ThresholdSignatureSchemeBLS12381G1PKG2SigNUL, - Signature: signature, - }) - require.ErrorIs(t, err, types.ErrInvalidThresholdSignature) - - stored = k.getPost(ctx, namespaceId, postId) - require.NotNil(t, stored) - require.Equal(t, staleCurrentPayload, stored.Payload) - - staleNoncePayload := ringPayloadWithSeedAndNonce( - t, - "sourcehub-bulletin-bls-test-seed-0001", - []string{"peer1"}, - 1, - []string{"peer2"}, - uint32Ptr(2), - 9, - ) - k.SetPost(ctx, types.Post{ - Id: postId, - Namespace: namespaceId, - CreatorDid: ownerDID, - Payload: staleNoncePayload, - }) - _, err = k.UpdateRingPostByThresholdSignature(ctx, &types.MsgUpdateRingPostByThresholdSignature{ - Creator: updater.Address, - Namespace: namespace, - PostId: postId, - SignatureScheme: ThresholdSignatureSchemeBLS12381G1PKG2SigNUL, - Signature: signature, - }) - require.ErrorIs(t, err, types.ErrInvalidThresholdSignature) - - stored = k.getPost(ctx, namespaceId, postId) - require.NotNil(t, stored) - require.Equal(t, staleNoncePayload, stored.Payload) - - k.SetPost(ctx, types.Post{ - Id: postId, - Namespace: namespaceId, - CreatorDid: ownerDID, - Payload: originalPayload, - }) - - _, err = k.UpdateRingPostByThresholdSignature(ctx, &types.MsgUpdateRingPostByThresholdSignature{ - Creator: updater.Address, - Namespace: namespace, - PostId: postId, - SignatureScheme: ThresholdSignatureSchemeBLS12381G1PKG2SigNUL, - Signature: signature, - }) - require.NoError(t, err) - - stored = k.getPost(ctx, namespaceId, postId) - require.NotNil(t, stored) - require.Equal(t, finalizedPayload, stored.Payload) - - _, err = k.UpdateRingPostByThresholdSignature(ctx, &types.MsgUpdateRingPostByThresholdSignature{ - Creator: updater.Address, - Namespace: namespace, - PostId: postId, - SignatureScheme: ThresholdSignatureSchemeBLS12381G1PKG2SigNUL, - Signature: signature, - }) - require.ErrorIs(t, err, types.ErrInvalidPostPayload) -} - -func signedRingPayload(t *testing.T, peerIDs []string, threshold uint32) ([]byte, []byte) { - t.Helper() - - return signedRingPayloadWithSeed(t, "sourcehub-bulletin-bls-test-seed-0001", peerIDs, threshold) -} - -func signedRingPayloadWithSeed(t *testing.T, seed string, peerIDs []string, threshold uint32) ([]byte, []byte) { - t.Helper() - - payload := ringPayloadWithSeed(t, seed, peerIDs, threshold, nil, nil) - signature := signPayloadWithSeed(t, seed, payload) - - return payload, signature -} - -type testRingPayload struct { - RingPK string `json:"ring_pk"` - NewPeerIDs []string `json:"new_peer_ids,omitempty"` - NewThreshold *uint32 `json:"new_threshold,omitempty"` - PeerIDs []string `json:"peer_ids"` - Threshold uint32 `json:"threshold"` - PSSInterval *uint64 `json:"pss_interval,omitempty"` - BlockNumberNonce uint64 `json:"block_number_nonce"` -} - -func ringPayloadWithSeed( - t *testing.T, - seed string, - peerIDs []string, - threshold uint32, - newPeerIDs []string, - newThreshold *uint32, -) []byte { - t.Helper() - - return ringPayloadWithSeedAndNonce(t, seed, peerIDs, threshold, newPeerIDs, newThreshold, 0) -} - -func ringPayloadWithSeedAndNonce( - t *testing.T, - seed string, - peerIDs []string, - threshold uint32, - newPeerIDs []string, - newThreshold *uint32, - blockNumberNonce uint64, -) []byte { - t.Helper() - require.NotEmpty(t, peerIDs) - - secretKey := blst.KeyGen([]byte(seed)) - require.NotNil(t, secretKey) - publicKey := new(blst.P1Affine).From(secretKey) - - payload, err := json.Marshal(testRingPayload{ - RingPK: hex.EncodeToString(publicKey.Compress()), - NewPeerIDs: newPeerIDs, - NewThreshold: newThreshold, - PeerIDs: peerIDs, - Threshold: threshold, - BlockNumberNonce: blockNumberNonce, - }) - require.NoError(t, err) - - return payload -} - -func signPayloadWithSeed(t *testing.T, seed string, payload []byte) []byte { - t.Helper() - - secretKey := blst.KeyGen([]byte(seed)) - require.NotNil(t, secretKey) - signature := new(blst.P2Affine).Sign(secretKey, payload, []byte(bls12381G2SignatureDST)) - - return signature.Compress() -} - -func signReshareFinalizePayload( - t *testing.T, - chainID string, - namespace string, - postID string, - currentPayload []byte, - finalizedPayload []byte, - seed string, -) []byte { - t.Helper() - - currentRingPayload, err := parseRingPayloadJSON(currentPayload) - require.NoError(t, err) - signBytes, err := ringReshareFinalizeSignBytes(chainID, namespace, postID, currentPayload, finalizedPayload, currentRingPayload) - require.NoError(t, err) - - return signPayloadWithSeed(t, seed, signBytes) -} - -func uint32Ptr(v uint32) *uint32 { - return &v -} - -// TestPolicy_CreatePostPermissionSurvives locks in that the `create_post` -// permission remains queryable via ACP with the `collaborator` relation. -// The keeper no longer gates CreatePost with this permission, but external -// consumers may still query it — this guards against accidental removal -// from the policy YAML. -func TestPolicy_CreatePostPermissionSurvives(t *testing.T) { - k, ctx := setupKeeper(t) - require.NoError(t, k.SetParams(ctx, types.DefaultParams())) - - ownerKey := secp256k1.GenPrivKey().PubKey() - owner := authtypes.NewBaseAccount(sdk.AccAddress(ownerKey.Address()), ownerKey, 1, 1) - k.accountKeeper.SetAccount(ctx, owner) - - collabKey := secp256k1.GenPrivKey().PubKey() - collab := authtypes.NewBaseAccount(sdk.AccAddress(collabKey.Address()), collabKey, 2, 1) - k.accountKeeper.SetAccount(ctx, collab) - - setupTestPolicy(t, ctx, k) - - namespace := "ns-create-perm" - namespaceId := getNamespaceId(namespace) - - _, err := k.RegisterNamespace(ctx, &types.MsgRegisterNamespace{ - Creator: owner.Address, - Namespace: namespace, - }) - require.NoError(t, err) - - _, err = k.AddCollaborator(ctx, &types.MsgAddCollaborator{ - Creator: owner.Address, - Namespace: namespace, - Collaborator: collab.Address, - }) - require.NoError(t, err) - - collabDID, err := k.GetAcpKeeper().IssueDIDFromAccountAddr(ctx, collab.Address) - require.NoError(t, err) - - allowed, err := hasPermission(ctx, &k, k.GetPolicyId(ctx), namespaceId, types.CreatePostPermission, collabDID, collab.Address) - require.NoError(t, err) - require.True(t, allowed, "create_post permission should resolve for a collaborator") - - outsiderKey := secp256k1.GenPrivKey().PubKey() - outsider := authtypes.NewBaseAccount(sdk.AccAddress(outsiderKey.Address()), outsiderKey, 3, 1) - k.accountKeeper.SetAccount(ctx, outsider) - - outsiderDID, err := k.GetAcpKeeper().IssueDIDFromAccountAddr(ctx, outsider.Address) - require.NoError(t, err) - - allowed, err = hasPermission(ctx, &k, k.GetPolicyId(ctx), namespaceId, types.CreatePostPermission, outsiderDID, outsider.Address) - require.NoError(t, err) - require.False(t, allowed, "create_post permission should deny a non-collaborator") -} - func TestMsgServer(t *testing.T) { k, ctx := setupKeeper(t) require.NotNil(t, ctx) @@ -1010,7 +232,7 @@ func TestMsgCreatePost(t *testing.T) { expErrMsg: "invalid post payload", }, { - name: "create post (error: namespace not found)", + name: "create post (error: no policy)", input: &types.MsgCreatePost{ Creator: baseAcc.Address, Namespace: namespace, @@ -1018,6 +240,19 @@ func TestMsgCreatePost(t *testing.T) { }, setup: func() {}, expErr: true, + expErrMsg: "invalid policy id", + }, + { + name: "create post (error: no namespace)", + input: &types.MsgCreatePost{ + Creator: baseAcc.Address, + Namespace: namespace, + Payload: []byte("post123"), + }, + setup: func() { + k.SetPolicyId(ctx, "policy1") + }, + expErr: true, expErrMsg: "namespace not found", }, { @@ -1050,13 +285,31 @@ func TestMsgCreatePost(t *testing.T) { expErrMsg: "post already exists", }, { - name: "create post from unrelated signer (no error: posting is open)", + name: "create post (error: unauthorized)", + input: &types.MsgCreatePost{ + Creator: baseAcc2.Address, + Namespace: namespace, + Payload: []byte("post1234"), + }, + setup: func() {}, + expErr: true, + expErrMsg: "expected authorized account as a post creator", + }, + { + name: "create post from collaborator (no error)", input: &types.MsgCreatePost{ Creator: baseAcc2.Address, Namespace: namespace, - Payload: []byte("post-from-other"), + Payload: []byte("post1234"), + }, + setup: func() { + _, err := k.AddCollaborator(ctx, &types.MsgAddCollaborator{ + Creator: baseAcc.Address, + Collaborator: baseAcc2.Address, + Namespace: namespace, + }) + require.NoError(t, err) }, - setup: func() {}, expErr: false, }, } @@ -1440,4 +693,4 @@ func TestMsgRemoveCollaborator(t *testing.T) { } }) } -} +} \ No newline at end of file diff --git a/x/bulletin/keeper/payload_validation.go b/x/bulletin/keeper/payload_validation.go deleted file mode 100644 index 583a7fd8..00000000 --- a/x/bulletin/keeper/payload_validation.go +++ /dev/null @@ -1,141 +0,0 @@ -package keeper - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - - "github.com/sourcenetwork/sourcehub/x/bulletin/types" -) - -type ringPayloadJSON struct { - RingPK *string `json:"ring_pk"` - NewPeerIDs *[]string `json:"new_peer_ids,omitempty"` - NewThreshold *uint32 `json:"new_threshold,omitempty"` - PeerIDs *[]string `json:"peer_ids"` - Threshold *uint32 `json:"threshold"` - PSSInterval *uint64 `json:"pss_interval,omitempty"` - BlockNumberNonce *uint64 `json:"block_number_nonce"` - PolicyID *string `json:"policy_id,omitempty"` -} - -func validateRingPayloadJSON(payload []byte) error { - _, err := parseRingPayloadJSON(payload) - return err -} - -func parseRingPayloadJSON(payload []byte) (*ringPayloadJSON, error) { - var ringPayload ringPayloadJSON - if err := json.Unmarshal(payload, &ringPayload); err != nil { - return nil, errorsmod.Wrapf(types.ErrInvalidPostPayload, "invalid ring payload JSON: %s", err) - } - - switch { - case ringPayload.RingPK == nil: - return nil, errorsmod.Wrap(types.ErrInvalidPostPayload, "invalid ring payload: missing ring_pk") - case ringPayload.PeerIDs == nil: - return nil, errorsmod.Wrap(types.ErrInvalidPostPayload, "invalid ring payload: missing peer_ids") - case ringPayload.Threshold == nil: - return nil, errorsmod.Wrap(types.ErrInvalidPostPayload, "invalid ring payload: missing threshold") - case ringPayload.BlockNumberNonce == nil: - return nil, errorsmod.Wrap(types.ErrInvalidPostPayload, "invalid ring payload: missing block_number_nonce") - } - - return &ringPayload, nil -} - -// validateRingPostUpdate checks that the fields being set via UpdateRingPostByAcp -// are internally consistent against the existing ring payload: -// - a reshare must not already be in progress when new_peer_ids or new_threshold are being changed -// - new_peer_ids must have no duplicates -// - new_threshold (if provided) must be at least 1 -// - the effective new_peer_ids count must be >= the effective new_threshold -// (drawing from the existing payload for whichever side is not being updated) -func validateRingPostUpdate(newPeerIDs []string, newThreshold *uint32, existing *ringPayloadJSON) error { - reshareInProgress := existing.NewPeerIDs != nil || existing.NewThreshold != nil - touchingReshareFields := len(newPeerIDs) > 0 || newThreshold != nil - if reshareInProgress && touchingReshareFields { - return types.ErrReshareInProgress - } - - if len(newPeerIDs) > 0 { - seen := make(map[string]struct{}, len(newPeerIDs)) - for _, id := range newPeerIDs { - if _, dup := seen[id]; dup { - return errorsmod.Wrapf(types.ErrInvalidPostPayload, "duplicate peer id in new_peer_ids: %q", id) - } - seen[id] = struct{}{} - } - } - if newThreshold != nil && *newThreshold < 1 { - return errorsmod.Wrap(types.ErrInvalidPostPayload, "new_threshold must be at least 1") - } - - effectivePeerIDs := newPeerIDs - if len(effectivePeerIDs) == 0 && existing.NewPeerIDs != nil { - effectivePeerIDs = *existing.NewPeerIDs - } - - effectiveThreshold := newThreshold - if effectiveThreshold == nil { - effectiveThreshold = existing.NewThreshold - } - - if len(effectivePeerIDs) > 0 && effectiveThreshold != nil && uint32(len(effectivePeerIDs)) < *effectiveThreshold { - return errorsmod.Wrapf( - types.ErrInvalidPostPayload, - "new_peer_ids count (%d) is less than new_threshold (%d)", - len(effectivePeerIDs), *effectiveThreshold, - ) - } - - return nil -} - -func ringPayloadForReshareFinalization(currentRingPayload *ringPayloadJSON) (*ringPayloadJSON, error) { - finalizedRingPayload := *currentRingPayload - if finalizedRingPayload.NewPeerIDs == nil && finalizedRingPayload.NewThreshold == nil { - return nil, errorsmod.Wrap(types.ErrInvalidPostPayload, "invalid ring payload: missing new_peer_ids or new_threshold for reshare finalization") - } - - if finalizedRingPayload.NewPeerIDs != nil { - finalizedRingPayload.PeerIDs = finalizedRingPayload.NewPeerIDs - } - if finalizedRingPayload.NewThreshold != nil { - finalizedRingPayload.Threshold = finalizedRingPayload.NewThreshold - } - finalizedRingPayload.NewPeerIDs = nil - finalizedRingPayload.NewThreshold = nil - - return &finalizedRingPayload, nil -} - -func deriveFinalizedRingPayloadReshare(currentRingPayload *ringPayloadJSON) ([]byte, error) { - finalizedRingPayload, err := ringPayloadForReshareFinalization(currentRingPayload) - if err != nil { - return nil, err - } - - finalizedPayload, err := json.Marshal(finalizedRingPayload) - if err != nil { - return nil, errorsmod.Wrapf(types.ErrInvalidPostPayload, "could not finalize ring payload: %s", err) - } - - return finalizedPayload, nil -} - -func finalizeRingPayloadReshare(currentRingPayload *ringPayloadJSON, blockNumberNonce uint64) ([]byte, error) { - finalizedRingPayload, err := ringPayloadForReshareFinalization(currentRingPayload) - if err != nil { - return nil, err - } - - finalizedRingPayload.BlockNumberNonce = &blockNumberNonce - - finalizedPayload, err := json.Marshal(finalizedRingPayload) - if err != nil { - return nil, errorsmod.Wrapf(types.ErrInvalidPostPayload, "could not finalize ring payload: %s", err) - } - - return finalizedPayload, nil -} diff --git a/x/bulletin/keeper/payload_validation_test.go b/x/bulletin/keeper/payload_validation_test.go deleted file mode 100644 index 655d5b01..00000000 --- a/x/bulletin/keeper/payload_validation_test.go +++ /dev/null @@ -1,208 +0,0 @@ -package keeper - -import ( - "testing" - - "github.com/stretchr/testify/require" - - "github.com/sourcenetwork/sourcehub/x/bulletin/types" -) - -func TestValidateRingPayloadJSON(t *testing.T) { - testCases := []struct { - name string - payload []byte - expErr bool - }{ - { - name: "minimal valid payload", - payload: []byte(`{"ring_pk":"pk","peer_ids":["peer1","peer2"],"threshold":1,"block_number_nonce":0}`), - }, - { - name: "valid payload with optional fields", - payload: []byte(`{"ring_pk":"pk","new_peer_ids":["peer3","peer4"],"new_threshold":2,"peer_ids":["peer1","peer2"],"threshold":1,"pss_interval":60,"block_number_nonce":9}`), - }, - { - name: "valid payload with optional null fields", - payload: []byte(`{"ring_pk":"pk","new_peer_ids":null,"new_threshold":null,"peer_ids":["peer1"],"threshold":1,"pss_interval":null,"block_number_nonce":0}`), - }, - { - name: "unknown fields are accepted", - payload: []byte(`{"ring_pk":"pk","peer_ids":["peer1"],"threshold":1,"block_number_nonce":0,"extra":"ok"}`), - }, - { - name: "invalid json", - payload: []byte(`not-json`), - expErr: true, - }, - { - name: "missing ring_pk", - payload: []byte(`{"peer_ids":["peer1"],"threshold":1}`), - expErr: true, - }, - { - name: "missing peer_ids", - payload: []byte(`{"ring_pk":"pk","threshold":1}`), - expErr: true, - }, - { - name: "missing threshold", - payload: []byte(`{"ring_pk":"pk","peer_ids":["peer1"],"block_number_nonce":0}`), - expErr: true, - }, - { - name: "missing block number nonce", - payload: []byte(`{"ring_pk":"pk","peer_ids":["peer1"],"threshold":1}`), - expErr: true, - }, - { - name: "required null field is rejected", - payload: []byte(`{"ring_pk":"pk","peer_ids":null,"threshold":1}`), - expErr: true, - }, - { - name: "negative threshold is rejected", - payload: []byte(`{"ring_pk":"pk","peer_ids":["peer1"],"threshold":-1}`), - expErr: true, - }, - { - name: "non-string peer id is rejected", - payload: []byte(`{"ring_pk":"pk","peer_ids":["peer1",2],"threshold":1}`), - expErr: true, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - err := validateRingPayloadJSON(tc.payload) - if tc.expErr { - require.ErrorIs(t, err, types.ErrInvalidPostPayload) - return - } - require.NoError(t, err) - }) - } -} - -func TestFinalizeRingPayloadReshare(t *testing.T) { - currentPayload := []byte(`{"ring_pk":"pk","new_peer_ids":["peer2","peer3"],"new_threshold":2,"peer_ids":["peer1"],"threshold":1,"block_number_nonce":7}`) - currentRingPayload := requireParsedRingPayload(t, currentPayload) - - signDocFinalizedPayload, err := deriveFinalizedRingPayloadReshare(currentRingPayload) - require.NoError(t, err) - require.JSONEq(t, `{"ring_pk":"pk","peer_ids":["peer2","peer3"],"threshold":2,"block_number_nonce":7}`, string(signDocFinalizedPayload)) - - finalizedPayload, err := finalizeRingPayloadReshare(currentRingPayload, 42) - require.NoError(t, err) - require.JSONEq(t, `{"ring_pk":"pk","peer_ids":["peer2","peer3"],"threshold":2,"block_number_nonce":42}`, string(finalizedPayload)) - - currentPayloadWithPSSInterval := []byte(`{"ring_pk":"pk","new_peer_ids":["peer2","peer3"],"new_threshold":2,"peer_ids":["peer1"],"threshold":1,"pss_interval":60,"block_number_nonce":7}`) - finalizedPayload, err = finalizeRingPayloadReshare(requireParsedRingPayload(t, currentPayloadWithPSSInterval), 43) - require.NoError(t, err) - require.JSONEq(t, `{"ring_pk":"pk","peer_ids":["peer2","peer3"],"threshold":2,"pss_interval":60,"block_number_nonce":43}`, string(finalizedPayload)) - - currentPayloadWithNewPeerIDsOnly := []byte(`{"ring_pk":"pk","new_peer_ids":["peer2","peer3"],"peer_ids":["peer1"],"threshold":1,"block_number_nonce":7}`) - finalizedPayload, err = finalizeRingPayloadReshare(requireParsedRingPayload(t, currentPayloadWithNewPeerIDsOnly), 44) - require.NoError(t, err) - require.JSONEq(t, `{"ring_pk":"pk","peer_ids":["peer2","peer3"],"threshold":1,"block_number_nonce":44}`, string(finalizedPayload)) - - currentPayloadWithNewThresholdOnly := []byte(`{"ring_pk":"pk","new_threshold":2,"peer_ids":["peer1"],"threshold":1,"block_number_nonce":7}`) - finalizedPayload, err = finalizeRingPayloadReshare(requireParsedRingPayload(t, currentPayloadWithNewThresholdOnly), 45) - require.NoError(t, err) - require.JSONEq(t, `{"ring_pk":"pk","peer_ids":["peer1"],"threshold":2,"block_number_nonce":45}`, string(finalizedPayload)) - - _, err = finalizeRingPayloadReshare( - requireParsedRingPayload(t, []byte(`{"ring_pk":"pk","peer_ids":["peer1"],"threshold":1,"block_number_nonce":7}`)), - 46, - ) - require.ErrorIs(t, err, types.ErrInvalidPostPayload) - require.Contains(t, err.Error(), "missing new_peer_ids or new_threshold") -} - -func TestValidateRingPostUpdate(t *testing.T) { - ptr := func(v uint32) *uint32 { return &v } - empty := &ringPayloadJSON{} - - withExistingNewPeers := func(peers []string) *ringPayloadJSON { - return &ringPayloadJSON{NewPeerIDs: &peers} - } - withExistingNewThreshold := func(t uint32) *ringPayloadJSON { - return &ringPayloadJSON{NewThreshold: ptr(t)} - } - withExistingBoth := func(peers []string, thresh uint32) *ringPayloadJSON { - return &ringPayloadJSON{NewPeerIDs: &peers, NewThreshold: ptr(thresh)} - } - - t.Run("empty inputs are valid", func(t *testing.T) { - require.NoError(t, validateRingPostUpdate(nil, nil, empty)) - require.NoError(t, validateRingPostUpdate([]string{}, nil, empty)) - }) - - t.Run("unique peer ids are valid", func(t *testing.T) { - require.NoError(t, validateRingPostUpdate([]string{"peer1", "peer2", "peer3"}, nil, empty)) - }) - - t.Run("duplicate peer ids are rejected", func(t *testing.T) { - err := validateRingPostUpdate([]string{"peer1", "peer2", "peer1"}, nil, empty) - require.ErrorIs(t, err, types.ErrInvalidPostPayload) - require.Contains(t, err.Error(), "duplicate peer id") - }) - - t.Run("threshold of 1 is valid", func(t *testing.T) { - require.NoError(t, validateRingPostUpdate(nil, ptr(1), empty)) - }) - - t.Run("threshold above 1 is valid", func(t *testing.T) { - require.NoError(t, validateRingPostUpdate(nil, ptr(5), empty)) - }) - - t.Run("threshold of 0 is rejected", func(t *testing.T) { - err := validateRingPostUpdate(nil, ptr(0), empty) - require.ErrorIs(t, err, types.ErrInvalidPostPayload) - require.Contains(t, err.Error(), "new_threshold must be at least 1") - }) - - t.Run("new_peer_ids count >= new_threshold in same message is valid", func(t *testing.T) { - require.NoError(t, validateRingPostUpdate([]string{"p1", "p2", "p3"}, ptr(3), empty)) - }) - - t.Run("new_peer_ids count < new_threshold in same message is rejected", func(t *testing.T) { - err := validateRingPostUpdate([]string{"p1", "p2"}, ptr(3), empty) - require.ErrorIs(t, err, types.ErrInvalidPostPayload) - require.Contains(t, err.Error(), "new_peer_ids count") - }) - - t.Run("reshare in progress: new_peer_ids blocked when payload has new_threshold", func(t *testing.T) { - err := validateRingPostUpdate([]string{"p1"}, nil, withExistingNewThreshold(3)) - require.ErrorIs(t, err, types.ErrReshareInProgress) - }) - - t.Run("reshare in progress: new_threshold blocked when payload has new_peer_ids", func(t *testing.T) { - err := validateRingPostUpdate(nil, ptr(5), withExistingNewPeers([]string{"p1", "p2"})) - require.ErrorIs(t, err, types.ErrReshareInProgress) - }) - - t.Run("reshare in progress: new_peer_ids blocked even if count satisfies threshold", func(t *testing.T) { - err := validateRingPostUpdate([]string{"p1", "p2", "p3"}, nil, withExistingNewThreshold(2)) - require.ErrorIs(t, err, types.ErrReshareInProgress) - }) - - t.Run("no check when neither side has threshold set", func(t *testing.T) { - require.NoError(t, validateRingPostUpdate([]string{"p1"}, nil, empty)) - }) - - t.Run("no check when neither side has peer ids set", func(t *testing.T) { - require.NoError(t, validateRingPostUpdate(nil, ptr(3), empty)) - }) - - t.Run("existing both fields consistent passes through unchanged", func(t *testing.T) { - require.NoError(t, validateRingPostUpdate(nil, nil, withExistingBoth([]string{"p1", "p2"}, 2))) - }) -} - -func requireParsedRingPayload(t *testing.T, payload []byte) *ringPayloadJSON { - t.Helper() - ringPayload, err := parseRingPayloadJSON(payload) - require.NoError(t, err) - return ringPayload -} diff --git a/x/bulletin/keeper/reshare_sign_bytes.go b/x/bulletin/keeper/reshare_sign_bytes.go deleted file mode 100644 index 7128f1d3..00000000 --- a/x/bulletin/keeper/reshare_sign_bytes.go +++ /dev/null @@ -1,34 +0,0 @@ -package keeper - -import ( - "crypto/sha256" - - "github.com/sourcenetwork/sourcehub/x/bulletin/types" -) - -const RingReshareFinalizeSignDocDomain = "orbis-ring-reshare-finalize" - -func ringReshareFinalizeSignBytes( - chainID string, - namespace string, - postID string, - currentPayload []byte, - finalizedPayload []byte, - currentRingPayload *ringPayloadJSON, -) ([]byte, error) { - currentPayloadHash := sha256.Sum256(currentPayload) - finalizedPayloadHash := sha256.Sum256(finalizedPayload) - - signDoc := types.RingReshareFinalizeSignDoc{ - Domain: RingReshareFinalizeSignDocDomain, - ChainId: chainID, - Namespace: namespace, - PostId: postID, - RingPk: *currentRingPayload.RingPK, - CurrentPayloadSha256: currentPayloadHash[:], - FinalizedPayloadSha256: finalizedPayloadHash[:], - BlockNumberNonce: *currentRingPayload.BlockNumberNonce, - } - - return signDoc.Marshal() -} diff --git a/x/bulletin/keeper/reshare_sign_bytes_test.go b/x/bulletin/keeper/reshare_sign_bytes_test.go deleted file mode 100644 index 2ecc5c9b..00000000 --- a/x/bulletin/keeper/reshare_sign_bytes_test.go +++ /dev/null @@ -1,86 +0,0 @@ -package keeper - -import ( - "crypto/sha256" - "encoding/hex" - "encoding/json" - "os" - "testing" - - "github.com/stretchr/testify/require" - - "github.com/sourcenetwork/sourcehub/x/bulletin/types" -) - -type ringReshareFinalizeVector struct { - Domain string `json:"domain"` - ChainID string `json:"chain_id"` - Namespace string `json:"namespace"` - PostID string `json:"post_id"` - SignatureScheme string `json:"signature_scheme"` - BLSDST string `json:"bls_dst"` - SignerKeygenSeed string `json:"signer_keygen_seed"` - CurrentPayload string `json:"current_payload"` - FinalizedPayload string `json:"finalized_payload"` - CurrentPayloadSHA256Hex string `json:"current_payload_sha256_hex"` - FinalizedPayloadSHA256Hex string `json:"finalized_payload_sha256_hex"` - CanonicalSignBytesHex string `json:"canonical_sign_bytes_hex"` - RingPublicKeyHex string `json:"ring_public_key_hex"` - BlockNumberNonce uint64 `json:"block_number_nonce"` - SignatureHex string `json:"signature_hex"` -} - -func TestRingReshareFinalizeSignBytesVector(t *testing.T) { - vectorBytes, err := os.ReadFile("testdata/ring_reshare_finalize_vector.json") - require.NoError(t, err) - - var vector ringReshareFinalizeVector - require.NoError(t, json.Unmarshal(vectorBytes, &vector)) - require.Equal(t, RingReshareFinalizeSignDocDomain, vector.Domain) - require.Equal(t, ThresholdSignatureSchemeBLS12381G1PKG2SigNUL, vector.SignatureScheme) - require.Equal(t, bls12381G2SignatureDST, vector.BLSDST) - - currentPayload := []byte(vector.CurrentPayload) - currentRingPayload, err := parseRingPayloadJSON(currentPayload) - require.NoError(t, err) - finalizedPayload, err := deriveFinalizedRingPayloadReshare(currentRingPayload) - require.NoError(t, err) - require.Equal(t, vector.FinalizedPayload, string(finalizedPayload)) - - currentPayloadHash := sha256.Sum256(currentPayload) - finalizedPayloadHash := sha256.Sum256(finalizedPayload) - require.Equal(t, vector.CurrentPayloadSHA256Hex, hex.EncodeToString(currentPayloadHash[:])) - require.Equal(t, vector.FinalizedPayloadSHA256Hex, hex.EncodeToString(finalizedPayloadHash[:])) - - signBytes, err := ringReshareFinalizeSignBytes( - vector.ChainID, - vector.Namespace, - vector.PostID, - currentPayload, - finalizedPayload, - currentRingPayload, - ) - require.NoError(t, err) - require.Equal(t, vector.CanonicalSignBytesHex, hex.EncodeToString(signBytes)) - - var signDoc types.RingReshareFinalizeSignDoc - require.NoError(t, signDoc.Unmarshal(signBytes)) - require.Equal(t, vector.Domain, signDoc.Domain) - require.Equal(t, vector.ChainID, signDoc.ChainId) - require.Equal(t, vector.Namespace, signDoc.Namespace) - require.Equal(t, vector.PostID, signDoc.PostId) - require.Equal(t, vector.RingPublicKeyHex, signDoc.RingPk) - require.Equal(t, currentPayloadHash[:], signDoc.CurrentPayloadSha256) - require.Equal(t, finalizedPayloadHash[:], signDoc.FinalizedPayloadSha256) - require.Equal(t, vector.BlockNumberNonce, signDoc.BlockNumberNonce) - - ringPayload, err := parseRingPayloadJSON(currentPayload) - require.NoError(t, err) - require.Equal(t, vector.RingPublicKeyHex, *ringPayload.RingPK) - require.Equal(t, vector.BlockNumberNonce, *ringPayload.BlockNumberNonce) - - signature, err := hex.DecodeString(vector.SignatureHex) - require.NoError(t, err) - require.Equal(t, vector.SignatureHex, hex.EncodeToString(signPayloadWithSeed(t, vector.SignerKeygenSeed, signBytes))) - require.NoError(t, verifyThresholdSignature(vector.SignatureScheme, vector.RingPublicKeyHex, signBytes, signature)) -} diff --git a/x/bulletin/keeper/testdata/ring_reshare_finalize_vector.json b/x/bulletin/keeper/testdata/ring_reshare_finalize_vector.json deleted file mode 100644 index 4cac4f56..00000000 --- a/x/bulletin/keeper/testdata/ring_reshare_finalize_vector.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "domain": "orbis-ring-reshare-finalize", - "chain_id": "sourcehub-test", - "namespace": "orbis/rings/ring1", - "post_id": "ring1-post", - "signature_scheme": "bls12_381_g1_pk_g2_sig_nul", - "bls_dst": "BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_", - "signer_keygen_seed": "sourcehub-bulletin-bls-test-seed-0001", - "current_payload": "{\"ring_pk\":\"b2c05c1059dadae32a7092a4323977796c521fa5e241ee7fe34283b3595935b2b80fad135e3f91bf7307382017869c51\",\"new_peer_ids\":[\"peer2\",\"peer3\"],\"new_threshold\":2,\"peer_ids\":[\"peer1\"],\"threshold\":1,\"block_number_nonce\":7}", - "finalized_payload": "{\"ring_pk\":\"b2c05c1059dadae32a7092a4323977796c521fa5e241ee7fe34283b3595935b2b80fad135e3f91bf7307382017869c51\",\"peer_ids\":[\"peer2\",\"peer3\"],\"threshold\":2,\"block_number_nonce\":7}", - "current_payload_sha256_hex": "8cde10c79267249a42ef9fa915b6ab9b49aac6a2c53c907b3910602313d53a95", - "finalized_payload_sha256_hex": "38ef318a46fa1746c778d16b46ad66a37e2a2bd0c694f8ace8aeb95dff0c6f2a", - "canonical_sign_bytes_hex": "0a1b6f726269732d72696e672d726573686172652d66696e616c697a65120e736f757263656875622d746573741a116f726269732f72696e67732f72696e6731220a72696e67312d706f73742a6062326330356331303539646164616533326137303932613433323339373737393663353231666135653234316565376665333432383362333539353933356232623830666164313335653366393162663733303733383230313738363963353132208cde10c79267249a42ef9fa915b6ab9b49aac6a2c53c907b3910602313d53a953a2038ef318a46fa1746c778d16b46ad66a37e2a2bd0c694f8ace8aeb95dff0c6f2a4007", - "ring_public_key_hex": "b2c05c1059dadae32a7092a4323977796c521fa5e241ee7fe34283b3595935b2b80fad135e3f91bf7307382017869c51", - "block_number_nonce": 7, - "signature_hex": "ad60c9e8753ab6c485ce5ae1e73ededf38e475a334e2ecb53765a87a0b5a27b139f66f1e4398865607e3142bd11f88760f76215998c07fe862da51905c29cce0517097e2e66df45edcb5d3001c42bd63ed7592f2dc4d832368a576b7756dd121" -} diff --git a/x/bulletin/keeper/threshold_signature_test.go b/x/bulletin/keeper/threshold_signature_test.go deleted file mode 100644 index 4c53c221..00000000 --- a/x/bulletin/keeper/threshold_signature_test.go +++ /dev/null @@ -1,78 +0,0 @@ -package keeper - -import ( - "encoding/hex" - "testing" - - "github.com/stretchr/testify/require" - - "github.com/sourcenetwork/sourcehub/x/bulletin/types" -) - -func TestDecodeHexBytes(t *testing.T) { - decoded, err := decodeHexBytes("0aFF") - require.NoError(t, err) - require.Equal(t, []byte{0x0a, 0xff}, decoded) - - decoded, err = decodeHexBytes(" 0aff ") - require.NoError(t, err) - require.Equal(t, []byte{0x0a, 0xff}, decoded) - - _, err = decodeHexBytes("0x0aff") - require.Error(t, err) - - _, err = decodeHexBytes("AQIDBA==") - require.Error(t, err) - - _, err = decodeHexBytes("") - require.Error(t, err) -} - -func TestRingPayloadPublicKeyEncodingMatchesOrbisHex(t *testing.T) { - payload := ringPayloadWithSeed( - t, - "sourcehub-bulletin-bls-test-seed-0001", - []string{"peer1"}, - 1, - nil, - nil, - ) - ringPayload, err := parseRingPayloadJSON(payload) - require.NoError(t, err) - - publicKey, err := decodeHexBytes(*ringPayload.RingPK) - require.NoError(t, err) - require.Len(t, publicKey, bls12381PublicKeySize) - require.Equal(t, *ringPayload.RingPK, hex.EncodeToString(publicKey)) -} - -func TestVerifyDecaf377FROSTThresholdSignature(t *testing.T) { - publicKeyHex := "48b01e513dd37d94c3b48940dc133b92ccba7f546e99d3fc2e602d284f609f00" - message, err := hex.DecodeString("6f7262697320646563616633373720696e7465726f70206d657373616765") - require.NoError(t, err) - signature, err := hex.DecodeString("588125a8f4e2bab8d16affc4ca60c5f64b50d38d2bb053148021631f72e99b0626e73e709ee9e725af65a80d824a8207f11e3fe8a293f40828ad365a6d9e2200") - require.NoError(t, err) - - require.NoError(t, verifyThresholdSignature(ThresholdSignatureSchemeDecaf377FROST, publicKeyHex, message, signature)) - - tamperedSignature := append([]byte(nil), signature...) - tamperedSignature[4] ^= 0x01 - require.ErrorIs( - t, - verifyThresholdSignature(ThresholdSignatureSchemeDecaf377FROST, publicKeyHex, message, tamperedSignature), - types.ErrInvalidThresholdSignature, - ) - - wrongMessage := []byte("wrong message") - require.ErrorIs( - t, - verifyThresholdSignature(ThresholdSignatureSchemeDecaf377FROST, publicKeyHex, wrongMessage, signature), - types.ErrInvalidThresholdSignature, - ) - - require.ErrorIs( - t, - verifyThresholdSignature(ThresholdSignatureSchemeDecaf377FROST, publicKeyHex, message, signature[:len(signature)-1]), - types.ErrInvalidThresholdSignature, - ) -} diff --git a/x/bulletin/module/autocli.go b/x/bulletin/module/autocli.go index 74702124..80ee95c4 100644 --- a/x/bulletin/module/autocli.go +++ b/x/bulletin/module/autocli.go @@ -75,22 +75,6 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { Short: "Add a new post to the specified namespace", PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "namespace"}, {ProtoField: "payload"}}, }, - { - RpcMethod: "UpdateRingPostByAcp", - Use: "update-ring-post-by-acp [namespace] [post_id]", - Short: "Update new_peer_ids, new_threshold, and/or pss_interval of a ring post via ACP policy", - PositionalArgs: []*autocliv1.PositionalArgDescriptor{ - {ProtoField: "namespace"}, - {ProtoField: "post_id"}, - }, - }, - { - RpcMethod: "UpdateRingPostByThresholdSignature", - Use: "update-post-by-threshold-signature [namespace] [post_id] [signature_scheme] [signature]", - Short: "Finalize a reshare using a threshold signature", - Long: "Finalize a reshare using a threshold signature. The signature argument is a bytes field and must be base64-encoded.", - PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "namespace"}, {ProtoField: "post_id"}, {ProtoField: "signature_scheme"}, {ProtoField: "signature"}}, - }, { RpcMethod: "RegisterNamespace", Use: "register-namespace [namespace]", diff --git a/x/bulletin/types/codec.go b/x/bulletin/types/codec.go index fc28004d..6a8fa72c 100644 --- a/x/bulletin/types/codec.go +++ b/x/bulletin/types/codec.go @@ -9,8 +9,6 @@ import ( func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgCreatePost{}, - &MsgUpdateRingPostByAcp{}, - &MsgUpdateRingPostByThresholdSignature{}, &MsgRegisterNamespace{}, &MsgAddCollaborator{}, &MsgRemoveCollaborator{}, diff --git a/x/bulletin/types/errors.go b/x/bulletin/types/errors.go index ae640b91..159ec7d1 100644 --- a/x/bulletin/types/errors.go +++ b/x/bulletin/types/errors.go @@ -20,10 +20,4 @@ var ( ErrCollaboratorAlreadyExists = sdkerrors.Register(ModuleName, 1111, "collaborator already exists") ErrCollaboratorNotFound = sdkerrors.Register(ModuleName, 1112, "collaborator not found") ErrCouldNotEnsurePolicy = sdkerrors.Register(ModuleName, 1113, "could not ensure policy") - ErrInvalidThresholdSignature = sdkerrors.Register(ModuleName, 1114, "invalid threshold signature") - ErrInvalidPostId = sdkerrors.Register(ModuleName, 1115, "invalid post id") - ErrInvalidSignatureScheme = sdkerrors.Register(ModuleName, 1116, "invalid signature scheme") - ErrInvalidSignaturePayload = sdkerrors.Register(ModuleName, 1117, "invalid signature payload") - ErrRingPayloadMissingPolicyId = sdkerrors.Register(ModuleName, 1118, "ring payload missing policy_id") - ErrReshareInProgress = sdkerrors.Register(ModuleName, 1119, "reshare already in progress: finalize before changing reshare parameters") ) diff --git a/x/bulletin/types/message_update_ring_post_by_acp.go b/x/bulletin/types/message_update_ring_post_by_acp.go deleted file mode 100644 index b3569c67..00000000 --- a/x/bulletin/types/message_update_ring_post_by_acp.go +++ /dev/null @@ -1,30 +0,0 @@ -package types - -import ( - errorsmod "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -var _ sdk.Msg = &MsgUpdateRingPostByAcp{} - -func NewMsgUpdateRingPostByAcp(creator, namespace, postId string) *MsgUpdateRingPostByAcp { - return &MsgUpdateRingPostByAcp{ - Creator: creator, - Namespace: namespace, - PostId: postId, - } -} - -func (msg *MsgUpdateRingPostByAcp) ValidateBasic() error { - if _, err := sdk.AccAddressFromBech32(msg.Creator); err != nil { - return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) - } - if msg.Namespace == "" { - return ErrInvalidNamespaceId - } - if msg.PostId == "" { - return ErrInvalidPostId - } - return nil -} diff --git a/x/bulletin/types/tx.pb.go b/x/bulletin/types/tx.pb.go index 19ee65cc..877c0468 100644 --- a/x/bulletin/types/tx.pb.go +++ b/x/bulletin/types/tx.pb.go @@ -228,404 +228,6 @@ func (m *MsgCreatePostResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCreatePostResponse proto.InternalMessageInfo -type MsgUpdateRingPostByAcp struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` - PostId string `protobuf:"bytes,3,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"` - Artifact string `protobuf:"bytes,4,opt,name=artifact,proto3" json:"artifact,omitempty"` - NewPeerIds []string `protobuf:"bytes,5,rep,name=new_peer_ids,json=newPeerIds,proto3" json:"new_peer_ids,omitempty"` - // Types that are valid to be assigned to XNewThreshold: - // *MsgUpdateRingPostByAcp_NewThreshold - XNewThreshold isMsgUpdateRingPostByAcp_XNewThreshold `protobuf_oneof:"_new_threshold"` - // Types that are valid to be assigned to XPssInterval: - // *MsgUpdateRingPostByAcp_PssInterval - XPssInterval isMsgUpdateRingPostByAcp_XPssInterval `protobuf_oneof:"_pss_interval"` -} - -func (m *MsgUpdateRingPostByAcp) Reset() { *m = MsgUpdateRingPostByAcp{} } -func (m *MsgUpdateRingPostByAcp) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateRingPostByAcp) ProtoMessage() {} -func (*MsgUpdateRingPostByAcp) Descriptor() ([]byte, []int) { - return fileDescriptor_0497d0f203b2b5e8, []int{4} -} -func (m *MsgUpdateRingPostByAcp) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateRingPostByAcp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateRingPostByAcp.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 *MsgUpdateRingPostByAcp) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateRingPostByAcp.Merge(m, src) -} -func (m *MsgUpdateRingPostByAcp) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateRingPostByAcp) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateRingPostByAcp.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateRingPostByAcp proto.InternalMessageInfo - -type isMsgUpdateRingPostByAcp_XNewThreshold interface { - isMsgUpdateRingPostByAcp_XNewThreshold() - MarshalTo([]byte) (int, error) - Size() int -} -type isMsgUpdateRingPostByAcp_XPssInterval interface { - isMsgUpdateRingPostByAcp_XPssInterval() - MarshalTo([]byte) (int, error) - Size() int -} - -type MsgUpdateRingPostByAcp_NewThreshold struct { - NewThreshold uint32 `protobuf:"varint,6,opt,name=new_threshold,json=newThreshold,proto3,oneof" json:"new_threshold,omitempty"` -} -type MsgUpdateRingPostByAcp_PssInterval struct { - PssInterval uint64 `protobuf:"varint,7,opt,name=pss_interval,json=pssInterval,proto3,oneof" json:"pss_interval,omitempty"` -} - -func (*MsgUpdateRingPostByAcp_NewThreshold) isMsgUpdateRingPostByAcp_XNewThreshold() {} -func (*MsgUpdateRingPostByAcp_PssInterval) isMsgUpdateRingPostByAcp_XPssInterval() {} - -func (m *MsgUpdateRingPostByAcp) GetXNewThreshold() isMsgUpdateRingPostByAcp_XNewThreshold { - if m != nil { - return m.XNewThreshold - } - return nil -} -func (m *MsgUpdateRingPostByAcp) GetXPssInterval() isMsgUpdateRingPostByAcp_XPssInterval { - if m != nil { - return m.XPssInterval - } - return nil -} - -func (m *MsgUpdateRingPostByAcp) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *MsgUpdateRingPostByAcp) GetNamespace() string { - if m != nil { - return m.Namespace - } - return "" -} - -func (m *MsgUpdateRingPostByAcp) GetPostId() string { - if m != nil { - return m.PostId - } - return "" -} - -func (m *MsgUpdateRingPostByAcp) GetArtifact() string { - if m != nil { - return m.Artifact - } - return "" -} - -func (m *MsgUpdateRingPostByAcp) GetNewPeerIds() []string { - if m != nil { - return m.NewPeerIds - } - return nil -} - -func (m *MsgUpdateRingPostByAcp) GetNewThreshold() uint32 { - if x, ok := m.GetXNewThreshold().(*MsgUpdateRingPostByAcp_NewThreshold); ok { - return x.NewThreshold - } - return 0 -} - -func (m *MsgUpdateRingPostByAcp) GetPssInterval() uint64 { - if x, ok := m.GetXPssInterval().(*MsgUpdateRingPostByAcp_PssInterval); ok { - return x.PssInterval - } - return 0 -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*MsgUpdateRingPostByAcp) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*MsgUpdateRingPostByAcp_NewThreshold)(nil), - (*MsgUpdateRingPostByAcp_PssInterval)(nil), - } -} - -type MsgUpdateRingPostByAcpResponse struct { -} - -func (m *MsgUpdateRingPostByAcpResponse) Reset() { *m = MsgUpdateRingPostByAcpResponse{} } -func (m *MsgUpdateRingPostByAcpResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateRingPostByAcpResponse) ProtoMessage() {} -func (*MsgUpdateRingPostByAcpResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0497d0f203b2b5e8, []int{5} -} -func (m *MsgUpdateRingPostByAcpResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateRingPostByAcpResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateRingPostByAcpResponse.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 *MsgUpdateRingPostByAcpResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateRingPostByAcpResponse.Merge(m, src) -} -func (m *MsgUpdateRingPostByAcpResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateRingPostByAcpResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateRingPostByAcpResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateRingPostByAcpResponse proto.InternalMessageInfo - -type MsgUpdateRingPostByThresholdSignature struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` - PostId string `protobuf:"bytes,3,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"` - Artifact string `protobuf:"bytes,4,opt,name=artifact,proto3" json:"artifact,omitempty"` - SignatureScheme string `protobuf:"bytes,5,opt,name=signature_scheme,json=signatureScheme,proto3" json:"signature_scheme,omitempty"` - Signature []byte `protobuf:"bytes,6,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (m *MsgUpdateRingPostByThresholdSignature) Reset() { *m = MsgUpdateRingPostByThresholdSignature{} } -func (m *MsgUpdateRingPostByThresholdSignature) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateRingPostByThresholdSignature) ProtoMessage() {} -func (*MsgUpdateRingPostByThresholdSignature) Descriptor() ([]byte, []int) { - return fileDescriptor_0497d0f203b2b5e8, []int{6} -} -func (m *MsgUpdateRingPostByThresholdSignature) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateRingPostByThresholdSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateRingPostByThresholdSignature.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 *MsgUpdateRingPostByThresholdSignature) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateRingPostByThresholdSignature.Merge(m, src) -} -func (m *MsgUpdateRingPostByThresholdSignature) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateRingPostByThresholdSignature) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateRingPostByThresholdSignature.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateRingPostByThresholdSignature proto.InternalMessageInfo - -func (m *MsgUpdateRingPostByThresholdSignature) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *MsgUpdateRingPostByThresholdSignature) GetNamespace() string { - if m != nil { - return m.Namespace - } - return "" -} - -func (m *MsgUpdateRingPostByThresholdSignature) GetPostId() string { - if m != nil { - return m.PostId - } - return "" -} - -func (m *MsgUpdateRingPostByThresholdSignature) GetArtifact() string { - if m != nil { - return m.Artifact - } - return "" -} - -func (m *MsgUpdateRingPostByThresholdSignature) GetSignatureScheme() string { - if m != nil { - return m.SignatureScheme - } - return "" -} - -func (m *MsgUpdateRingPostByThresholdSignature) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -type MsgUpdateRingPostByThresholdSignatureResponse struct { -} - -func (m *MsgUpdateRingPostByThresholdSignatureResponse) Reset() { - *m = MsgUpdateRingPostByThresholdSignatureResponse{} -} -func (m *MsgUpdateRingPostByThresholdSignatureResponse) String() string { - return proto.CompactTextString(m) -} -func (*MsgUpdateRingPostByThresholdSignatureResponse) ProtoMessage() {} -func (*MsgUpdateRingPostByThresholdSignatureResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0497d0f203b2b5e8, []int{7} -} -func (m *MsgUpdateRingPostByThresholdSignatureResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateRingPostByThresholdSignatureResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateRingPostByThresholdSignatureResponse.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 *MsgUpdateRingPostByThresholdSignatureResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateRingPostByThresholdSignatureResponse.Merge(m, src) -} -func (m *MsgUpdateRingPostByThresholdSignatureResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateRingPostByThresholdSignatureResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateRingPostByThresholdSignatureResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateRingPostByThresholdSignatureResponse proto.InternalMessageInfo - -type RingReshareFinalizeSignDoc struct { - Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"` - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` - PostId string `protobuf:"bytes,4,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty"` - RingPk string `protobuf:"bytes,5,opt,name=ring_pk,json=ringPk,proto3" json:"ring_pk,omitempty"` - CurrentPayloadSha256 []byte `protobuf:"bytes,6,opt,name=current_payload_sha256,json=currentPayloadSha256,proto3" json:"current_payload_sha256,omitempty"` - FinalizedPayloadSha256 []byte `protobuf:"bytes,7,opt,name=finalized_payload_sha256,json=finalizedPayloadSha256,proto3" json:"finalized_payload_sha256,omitempty"` - BlockNumberNonce uint64 `protobuf:"varint,8,opt,name=block_number_nonce,json=blockNumberNonce,proto3" json:"block_number_nonce,omitempty"` -} - -func (m *RingReshareFinalizeSignDoc) Reset() { *m = RingReshareFinalizeSignDoc{} } -func (m *RingReshareFinalizeSignDoc) String() string { return proto.CompactTextString(m) } -func (*RingReshareFinalizeSignDoc) ProtoMessage() {} -func (*RingReshareFinalizeSignDoc) Descriptor() ([]byte, []int) { - return fileDescriptor_0497d0f203b2b5e8, []int{8} -} -func (m *RingReshareFinalizeSignDoc) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RingReshareFinalizeSignDoc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RingReshareFinalizeSignDoc.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 *RingReshareFinalizeSignDoc) XXX_Merge(src proto.Message) { - xxx_messageInfo_RingReshareFinalizeSignDoc.Merge(m, src) -} -func (m *RingReshareFinalizeSignDoc) XXX_Size() int { - return m.Size() -} -func (m *RingReshareFinalizeSignDoc) XXX_DiscardUnknown() { - xxx_messageInfo_RingReshareFinalizeSignDoc.DiscardUnknown(m) -} - -var xxx_messageInfo_RingReshareFinalizeSignDoc proto.InternalMessageInfo - -func (m *RingReshareFinalizeSignDoc) GetDomain() string { - if m != nil { - return m.Domain - } - return "" -} - -func (m *RingReshareFinalizeSignDoc) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - -func (m *RingReshareFinalizeSignDoc) GetNamespace() string { - if m != nil { - return m.Namespace - } - return "" -} - -func (m *RingReshareFinalizeSignDoc) GetPostId() string { - if m != nil { - return m.PostId - } - return "" -} - -func (m *RingReshareFinalizeSignDoc) GetRingPk() string { - if m != nil { - return m.RingPk - } - return "" -} - -func (m *RingReshareFinalizeSignDoc) GetCurrentPayloadSha256() []byte { - if m != nil { - return m.CurrentPayloadSha256 - } - return nil -} - -func (m *RingReshareFinalizeSignDoc) GetFinalizedPayloadSha256() []byte { - if m != nil { - return m.FinalizedPayloadSha256 - } - return nil -} - -func (m *RingReshareFinalizeSignDoc) GetBlockNumberNonce() uint64 { - if m != nil { - return m.BlockNumberNonce - } - return 0 -} - type MsgRegisterNamespace struct { Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` @@ -635,7 +237,7 @@ func (m *MsgRegisterNamespace) Reset() { *m = MsgRegisterNamespace{} } func (m *MsgRegisterNamespace) String() string { return proto.CompactTextString(m) } func (*MsgRegisterNamespace) ProtoMessage() {} func (*MsgRegisterNamespace) Descriptor() ([]byte, []int) { - return fileDescriptor_0497d0f203b2b5e8, []int{9} + return fileDescriptor_0497d0f203b2b5e8, []int{4} } func (m *MsgRegisterNamespace) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -686,7 +288,7 @@ func (m *MsgRegisterNamespaceResponse) Reset() { *m = MsgRegisterNamespa func (m *MsgRegisterNamespaceResponse) String() string { return proto.CompactTextString(m) } func (*MsgRegisterNamespaceResponse) ProtoMessage() {} func (*MsgRegisterNamespaceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0497d0f203b2b5e8, []int{10} + return fileDescriptor_0497d0f203b2b5e8, []int{5} } func (m *MsgRegisterNamespaceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -732,7 +334,7 @@ func (m *MsgAddCollaborator) Reset() { *m = MsgAddCollaborator{} } func (m *MsgAddCollaborator) String() string { return proto.CompactTextString(m) } func (*MsgAddCollaborator) ProtoMessage() {} func (*MsgAddCollaborator) Descriptor() ([]byte, []int) { - return fileDescriptor_0497d0f203b2b5e8, []int{11} + return fileDescriptor_0497d0f203b2b5e8, []int{6} } func (m *MsgAddCollaborator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -790,7 +392,7 @@ func (m *MsgAddCollaboratorResponse) Reset() { *m = MsgAddCollaboratorRe func (m *MsgAddCollaboratorResponse) String() string { return proto.CompactTextString(m) } func (*MsgAddCollaboratorResponse) ProtoMessage() {} func (*MsgAddCollaboratorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0497d0f203b2b5e8, []int{12} + return fileDescriptor_0497d0f203b2b5e8, []int{7} } func (m *MsgAddCollaboratorResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -836,7 +438,7 @@ func (m *MsgRemoveCollaborator) Reset() { *m = MsgRemoveCollaborator{} } func (m *MsgRemoveCollaborator) String() string { return proto.CompactTextString(m) } func (*MsgRemoveCollaborator) ProtoMessage() {} func (*MsgRemoveCollaborator) Descriptor() ([]byte, []int) { - return fileDescriptor_0497d0f203b2b5e8, []int{13} + return fileDescriptor_0497d0f203b2b5e8, []int{8} } func (m *MsgRemoveCollaborator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -894,7 +496,7 @@ func (m *MsgRemoveCollaboratorResponse) Reset() { *m = MsgRemoveCollabor func (m *MsgRemoveCollaboratorResponse) String() string { return proto.CompactTextString(m) } func (*MsgRemoveCollaboratorResponse) ProtoMessage() {} func (*MsgRemoveCollaboratorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0497d0f203b2b5e8, []int{14} + return fileDescriptor_0497d0f203b2b5e8, []int{9} } func (m *MsgRemoveCollaboratorResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -935,11 +537,6 @@ func init() { proto.RegisterType((*MsgUpdateParamsResponse)(nil), "sourcehub.bulletin.MsgUpdateParamsResponse") proto.RegisterType((*MsgCreatePost)(nil), "sourcehub.bulletin.MsgCreatePost") proto.RegisterType((*MsgCreatePostResponse)(nil), "sourcehub.bulletin.MsgCreatePostResponse") - proto.RegisterType((*MsgUpdateRingPostByAcp)(nil), "sourcehub.bulletin.MsgUpdateRingPostByAcp") - proto.RegisterType((*MsgUpdateRingPostByAcpResponse)(nil), "sourcehub.bulletin.MsgUpdateRingPostByAcpResponse") - proto.RegisterType((*MsgUpdateRingPostByThresholdSignature)(nil), "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignature") - proto.RegisterType((*MsgUpdateRingPostByThresholdSignatureResponse)(nil), "sourcehub.bulletin.MsgUpdateRingPostByThresholdSignatureResponse") - proto.RegisterType((*RingReshareFinalizeSignDoc)(nil), "sourcehub.bulletin.RingReshareFinalizeSignDoc") proto.RegisterType((*MsgRegisterNamespace)(nil), "sourcehub.bulletin.MsgRegisterNamespace") proto.RegisterType((*MsgRegisterNamespaceResponse)(nil), "sourcehub.bulletin.MsgRegisterNamespaceResponse") proto.RegisterType((*MsgAddCollaborator)(nil), "sourcehub.bulletin.MsgAddCollaborator") @@ -951,72 +548,47 @@ func init() { func init() { proto.RegisterFile("sourcehub/bulletin/tx.proto", fileDescriptor_0497d0f203b2b5e8) } var fileDescriptor_0497d0f203b2b5e8 = []byte{ - // 1025 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0xcf, 0x73, 0xdb, 0x44, - 0x14, 0xce, 0xe6, 0x87, 0x13, 0xbf, 0x3a, 0x38, 0x15, 0x21, 0x56, 0x44, 0xeb, 0x1a, 0x01, 0x1d, - 0x27, 0x50, 0x9b, 0xa6, 0x50, 0xa0, 0x0c, 0x87, 0xb8, 0x1d, 0x68, 0x98, 0x71, 0x26, 0xa3, 0xc0, - 0xa5, 0x30, 0x23, 0x64, 0x69, 0x2b, 0xef, 0xc4, 0xd2, 0x6a, 0x76, 0xd7, 0x49, 0xc3, 0x81, 0x01, - 0x4e, 0x1d, 0xb8, 0xf0, 0x37, 0x70, 0x62, 0x38, 0xe5, 0xc0, 0x70, 0xe3, 0xc0, 0xad, 0xc7, 0x0e, - 0x27, 0x4e, 0x0c, 0x93, 0x1c, 0x72, 0xe0, 0x9f, 0x60, 0x56, 0x92, 0x65, 0x4b, 0x56, 0x8a, 0xc7, - 0x07, 0xb8, 0x24, 0x7e, 0xef, 0x7d, 0xef, 0xbd, 0xef, 0x7d, 0xfb, 0x4b, 0xf0, 0x22, 0xa7, 0x7d, - 0x66, 0xe3, 0x6e, 0xbf, 0xd3, 0xec, 0xf4, 0x7b, 0x3d, 0x2c, 0x88, 0xdf, 0x14, 0x8f, 0x1a, 0x01, - 0xa3, 0x82, 0x2a, 0x4a, 0x12, 0x6c, 0x0c, 0x82, 0xda, 0x65, 0xcb, 0x23, 0x3e, 0x6d, 0x86, 0x7f, - 0x23, 0x98, 0x56, 0xb1, 0x29, 0xf7, 0x28, 0x6f, 0x7a, 0xdc, 0x6d, 0x1e, 0xde, 0x94, 0xff, 0xe2, - 0xc0, 0x7a, 0x14, 0x30, 0x43, 0xab, 0x19, 0x19, 0x71, 0x68, 0xd5, 0xa5, 0x2e, 0x8d, 0xfc, 0xf2, - 0x57, 0xec, 0xbd, 0x96, 0xc3, 0x26, 0xb0, 0x98, 0xe5, 0x0d, 0xd2, 0xf4, 0x1c, 0x80, 0x6f, 0x79, - 0x98, 0x07, 0x96, 0x8d, 0x23, 0x8c, 0xfe, 0x1b, 0x82, 0x72, 0x9b, 0xbb, 0x9f, 0x04, 0x8e, 0x25, - 0xf0, 0x5e, 0x98, 0xad, 0xdc, 0x86, 0xa2, 0xd5, 0x17, 0x5d, 0xca, 0x88, 0x38, 0x56, 0x51, 0x0d, - 0xd5, 0x8b, 0x2d, 0xf5, 0xf7, 0x9f, 0x6f, 0xac, 0xc6, 0x9c, 0xb6, 0x1d, 0x87, 0x61, 0xce, 0xf7, - 0x05, 0x23, 0xbe, 0x6b, 0x0c, 0xa1, 0xca, 0xfb, 0x50, 0x88, 0xfa, 0xab, 0xb3, 0x35, 0x54, 0xbf, - 0xb4, 0xa5, 0x35, 0xc6, 0x25, 0x69, 0x44, 0x3d, 0x5a, 0xc5, 0x27, 0x7f, 0x5e, 0x9b, 0xf9, 0xf1, - 0xfc, 0x64, 0x13, 0x19, 0x71, 0xd2, 0x9d, 0xb7, 0xbf, 0x39, 0x3f, 0xd9, 0x1c, 0x96, 0xfb, 0xf6, - 0xfc, 0x64, 0xf3, 0x95, 0xe1, 0x04, 0x8f, 0x86, 0x33, 0x64, 0xf8, 0xea, 0xeb, 0x50, 0xc9, 0xb8, - 0x0c, 0xcc, 0x03, 0xea, 0x73, 0xac, 0x7f, 0x87, 0x60, 0xb9, 0xcd, 0xdd, 0xbb, 0x0c, 0xcb, 0x18, - 0xe5, 0x42, 0x51, 0x61, 0xd1, 0x96, 0x16, 0x65, 0xd1, 0x68, 0xc6, 0xc0, 0x54, 0xae, 0x40, 0x31, - 0x51, 0x27, 0x9c, 0xa0, 0x68, 0x0c, 0x1d, 0x32, 0x2f, 0xb0, 0x8e, 0x7b, 0xd4, 0x72, 0xd4, 0xb9, - 0x1a, 0xaa, 0x97, 0x8c, 0x81, 0xa9, 0x68, 0xb0, 0x64, 0x31, 0x41, 0x1e, 0x5a, 0xb6, 0x50, 0x17, - 0xc2, 0xb4, 0xc4, 0xbe, 0x53, 0x92, 0x33, 0x0d, 0x3a, 0xe8, 0x15, 0x78, 0x21, 0x45, 0x26, 0xa1, - 0xf9, 0xd3, 0x2c, 0xac, 0x25, 0x23, 0x18, 0xc4, 0x77, 0x65, 0xb4, 0x75, 0xbc, 0x6d, 0x07, 0x53, - 0xf3, 0xad, 0xc0, 0x62, 0x40, 0xb9, 0x30, 0x49, 0xc4, 0xb7, 0x68, 0x14, 0xa4, 0xb9, 0x93, 0xa6, - 0x3b, 0x9f, 0xa6, 0xab, 0xd4, 0xa0, 0xe4, 0xe3, 0x23, 0x33, 0xc0, 0x98, 0x99, 0xc4, 0xe1, 0xea, - 0x42, 0x6d, 0xae, 0x5e, 0x34, 0xc0, 0xc7, 0x47, 0x7b, 0x18, 0xb3, 0x1d, 0x87, 0x2b, 0x75, 0x58, - 0x96, 0x08, 0xd1, 0x65, 0x98, 0x77, 0x69, 0xcf, 0x51, 0x0b, 0x35, 0x54, 0x5f, 0xbe, 0x3f, 0x63, - 0xc8, 0xc4, 0x8f, 0x07, 0xde, 0xc7, 0x08, 0x29, 0xd7, 0xa1, 0x14, 0x70, 0x6e, 0x12, 0x5f, 0x60, - 0x76, 0x68, 0xf5, 0xd4, 0xc5, 0x1a, 0xaa, 0xcf, 0xdf, 0x47, 0xc6, 0xa5, 0x80, 0xf3, 0x9d, 0xd8, - 0xf9, 0x18, 0xa1, 0xb4, 0x44, 0xad, 0x15, 0x78, 0xce, 0x4c, 0x35, 0x68, 0x95, 0x61, 0xd9, 0x1c, - 0x2d, 0xa4, 0xd7, 0xa0, 0x9a, 0xaf, 0x55, 0x22, 0xe7, 0xdf, 0x08, 0x5e, 0xcd, 0x81, 0x24, 0xf4, - 0xf6, 0x89, 0xeb, 0x5b, 0xa2, 0xcf, 0xf0, 0x7f, 0xab, 0xee, 0x06, 0xac, 0xf0, 0x41, 0x67, 0x93, - 0xdb, 0x5d, 0xec, 0xe1, 0x78, 0xc3, 0x94, 0x13, 0xff, 0x7e, 0xe8, 0x96, 0xdd, 0x13, 0x57, 0x28, - 0x71, 0xc9, 0x18, 0x3a, 0x32, 0xbb, 0xaa, 0x09, 0x37, 0x26, 0x1a, 0x36, 0x91, 0xe7, 0xd7, 0x59, - 0xd0, 0x24, 0xd0, 0xc0, 0xbc, 0x6b, 0x31, 0xfc, 0x01, 0xf1, 0xad, 0x1e, 0xf9, 0x02, 0x4b, 0xe0, - 0x3d, 0x6a, 0x2b, 0x6b, 0x50, 0x70, 0xa8, 0x67, 0x11, 0x3f, 0x96, 0x24, 0xb6, 0x94, 0x75, 0x58, - 0xb2, 0xbb, 0x16, 0xf1, 0xe5, 0xd0, 0xb3, 0xb1, 0x58, 0xd2, 0xde, 0x71, 0xd2, 0x62, 0xcd, 0x3d, - 0x43, 0xac, 0xf9, 0x94, 0x58, 0x15, 0x58, 0x94, 0x77, 0x88, 0x19, 0x1c, 0xc4, 0x3a, 0x14, 0xa4, - 0xb9, 0x77, 0xa0, 0xbc, 0x09, 0x6b, 0x76, 0x9f, 0x31, 0xec, 0x0b, 0x33, 0x3e, 0x65, 0x26, 0xef, - 0x5a, 0x5b, 0x6f, 0xdd, 0x8e, 0xb5, 0x58, 0x8d, 0xa3, 0x7b, 0x51, 0x70, 0x3f, 0x8c, 0x29, 0xef, - 0x80, 0xfa, 0x30, 0x9e, 0xc5, 0xc9, 0xe6, 0x2d, 0x86, 0x79, 0x6b, 0x49, 0x3c, 0x9d, 0xf9, 0x3a, - 0x28, 0x9d, 0x1e, 0xb5, 0x0f, 0x4c, 0xbf, 0xef, 0x75, 0x30, 0x33, 0x7d, 0xea, 0xdb, 0x58, 0x5d, - 0x92, 0x3b, 0xd6, 0x58, 0x09, 0x23, 0xbb, 0x61, 0x60, 0x57, 0xfa, 0xf5, 0xcf, 0x60, 0xb5, 0xcd, - 0x5d, 0x03, 0xbb, 0x84, 0x0b, 0xcc, 0x76, 0x47, 0xaf, 0x88, 0x69, 0x36, 0x53, 0x66, 0x39, 0x3f, - 0x85, 0x2b, 0x79, 0xd5, 0x07, 0xab, 0xa7, 0xbc, 0x37, 0x5a, 0x0b, 0x85, 0x17, 0xed, 0xd5, 0xbc, - 0x8b, 0x76, 0x98, 0x39, 0xc4, 0xeb, 0x5f, 0x82, 0xd2, 0xe6, 0xee, 0xb6, 0xe3, 0xdc, 0xa5, 0xbd, - 0x9e, 0xd5, 0xa1, 0x2c, 0xa4, 0x37, 0xed, 0x29, 0xd0, 0xa1, 0x64, 0x8f, 0xd4, 0x89, 0x57, 0x3e, - 0xe5, 0xcb, 0x0c, 0xf7, 0x21, 0x68, 0xe3, 0xfd, 0x93, 0xd1, 0x36, 0x60, 0x65, 0x34, 0xd7, 0x74, - 0x88, 0x13, 0x13, 0x2a, 0x8f, 0xfa, 0xef, 0x11, 0x47, 0xff, 0x1a, 0x85, 0x77, 0xa9, 0x81, 0x3d, - 0x7a, 0x88, 0xff, 0xa7, 0x61, 0x3e, 0x82, 0xab, 0xb9, 0x14, 0xa6, 0x98, 0x67, 0xeb, 0x97, 0x02, - 0xcc, 0xb5, 0xb9, 0xab, 0x7c, 0x0e, 0xa5, 0xd4, 0x5b, 0xfc, 0x72, 0xde, 0xd2, 0x66, 0x5e, 0x3b, - 0xed, 0xb5, 0x09, 0x40, 0x09, 0xa9, 0x07, 0x00, 0x23, 0xcf, 0xe1, 0x4b, 0x17, 0xa4, 0x0e, 0x21, - 0xda, 0xc6, 0xbf, 0x42, 0x92, 0xda, 0x7d, 0x78, 0x3e, 0xef, 0x0d, 0xdb, 0x7c, 0x26, 0xbf, 0x14, - 0x56, 0xdb, 0x9a, 0x1c, 0x9b, 0xb4, 0xfd, 0x01, 0x81, 0x3e, 0xc1, 0x65, 0xff, 0xee, 0x84, 0xa5, - 0xc7, 0x53, 0xb5, 0xed, 0xa9, 0x53, 0x13, 0x92, 0x14, 0x2e, 0x8f, 0x5f, 0x19, 0xf5, 0x0b, 0xea, - 0x8e, 0x21, 0xb5, 0x37, 0x26, 0x45, 0x26, 0x0d, 0x09, 0x94, 0xb3, 0x07, 0xfd, 0xfa, 0x05, 0x45, - 0x32, 0x38, 0xad, 0x31, 0x19, 0x2e, 0x69, 0xc5, 0x40, 0xc9, 0x39, 0x89, 0x1b, 0x17, 0x52, 0xce, - 0x42, 0xb5, 0x9b, 0x13, 0x43, 0x07, 0x3d, 0xb5, 0x85, 0xaf, 0xe4, 0xd7, 0x63, 0xab, 0xfd, 0xe4, - 0xb4, 0x8a, 0x9e, 0x9e, 0x56, 0xd1, 0x5f, 0xa7, 0x55, 0xf4, 0xfd, 0x59, 0x75, 0xe6, 0xe9, 0x59, - 0x75, 0xe6, 0x8f, 0xb3, 0xea, 0xcc, 0x83, 0x5b, 0x2e, 0x11, 0xb2, 0x9e, 0x4d, 0xbd, 0x66, 0x54, - 0xdd, 0xc7, 0xe2, 0x88, 0xb2, 0x83, 0x66, 0xee, 0x57, 0xa5, 0x38, 0x0e, 0x30, 0xef, 0x14, 0xc2, - 0xcf, 0xe2, 0x5b, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x1c, 0x01, 0xb3, 0x41, 0xeb, 0x0b, 0x00, - 0x00, + // 638 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0x4f, 0x4f, 0xd4, 0x5e, + 0x14, 0x9d, 0xf7, 0xe3, 0x07, 0xda, 0xeb, 0x18, 0xa4, 0xc1, 0x50, 0x2a, 0x14, 0xac, 0xc6, 0x0c, + 0x18, 0xa7, 0x02, 0x89, 0x26, 0x18, 0x17, 0x80, 0x89, 0x89, 0x49, 0x8d, 0xa9, 0x71, 0x83, 0x26, + 0xf8, 0xa6, 0x7d, 0x96, 0xc6, 0x69, 0x5f, 0xf3, 0xde, 0x1b, 0x84, 0x8d, 0x51, 0x97, 0xba, 0x71, + 0xed, 0x27, 0x70, 0xc9, 0xc2, 0x2f, 0xe0, 0x8e, 0x25, 0x71, 0xe5, 0xca, 0x18, 0x58, 0xf0, 0x35, + 0x4c, 0xff, 0x97, 0x4e, 0x27, 0x4e, 0xd8, 0xb8, 0x99, 0x99, 0x7b, 0xef, 0xb9, 0xe7, 0x9c, 0xfb, + 0x5e, 0x6f, 0x07, 0xae, 0x70, 0xda, 0x63, 0x36, 0xd9, 0xee, 0x75, 0x8c, 0x4e, 0xaf, 0xdb, 0x25, + 0xc2, 0x0b, 0x0c, 0xb1, 0xdb, 0x0e, 0x19, 0x15, 0x54, 0x96, 0xf3, 0x62, 0x3b, 0x2b, 0xaa, 0x13, + 0xd8, 0xf7, 0x02, 0x6a, 0xc4, 0x9f, 0x09, 0x4c, 0x9d, 0xb2, 0x29, 0xf7, 0x29, 0x37, 0x7c, 0xee, + 0x1a, 0x3b, 0x4b, 0xd1, 0x57, 0x5a, 0x98, 0x4e, 0x0a, 0x5b, 0x71, 0x64, 0x24, 0x41, 0x5a, 0x9a, + 0x74, 0xa9, 0x4b, 0x93, 0x7c, 0xf4, 0x2b, 0xcd, 0xea, 0x35, 0x6e, 0x02, 0xec, 0x13, 0x1e, 0x62, + 0x9b, 0xa4, 0x98, 0xb9, 0x1a, 0x4c, 0x88, 0x19, 0xf6, 0x53, 0x6a, 0xfd, 0x3b, 0x82, 0x71, 0x93, + 0xbb, 0xcf, 0x42, 0x07, 0x0b, 0xf2, 0x24, 0xae, 0xc8, 0x77, 0x40, 0xc2, 0x3d, 0xb1, 0x4d, 0x99, + 0x27, 0xf6, 0x14, 0x34, 0x8f, 0x5a, 0xd2, 0xba, 0xf2, 0xe3, 0xdb, 0xad, 0xc9, 0xd4, 0xd3, 0x9a, + 0xe3, 0x30, 0xc2, 0xf9, 0x53, 0xc1, 0xbc, 0xc0, 0xb5, 0x0a, 0xa8, 0x7c, 0x1f, 0xc6, 0x12, 0x6e, + 0xe5, 0xbf, 0x79, 0xd4, 0xba, 0xb0, 0xac, 0xb6, 0xfb, 0x8f, 0xa4, 0x9d, 0x68, 0xac, 0x4b, 0x07, + 0xbf, 0xe6, 0x1a, 0x5f, 0x4f, 0xf6, 0x17, 0x91, 0x95, 0x36, 0xad, 0xde, 0xfd, 0x70, 0xb2, 0xbf, + 0x58, 0xd0, 0x7d, 0x3c, 0xd9, 0x5f, 0xbc, 0x5e, 0xd8, 0xdf, 0x2d, 0x06, 0xa8, 0xf8, 0xd5, 0xa7, + 0x61, 0xaa, 0x92, 0xb2, 0x08, 0x0f, 0x69, 0xc0, 0x89, 0xfe, 0x09, 0xc1, 0x45, 0x93, 0xbb, 0x1b, + 0x8c, 0x44, 0x35, 0xca, 0x85, 0xac, 0xc0, 0x39, 0x3b, 0x8a, 0x28, 0x4b, 0x46, 0xb3, 0xb2, 0x50, + 0x9e, 0x01, 0x29, 0x3f, 0xbe, 0x78, 0x02, 0xc9, 0x2a, 0x12, 0x51, 0x5f, 0x88, 0xf7, 0xba, 0x14, + 0x3b, 0xca, 0xc8, 0x3c, 0x6a, 0x35, 0xad, 0x2c, 0x94, 0x55, 0x38, 0x8f, 0x99, 0xf0, 0x5e, 0x61, + 0x5b, 0x28, 0xa3, 0x71, 0x5b, 0x1e, 0xaf, 0x36, 0xa3, 0x99, 0x32, 0x05, 0x7d, 0x0a, 0x2e, 0x9f, + 0x32, 0x93, 0xdb, 0x7c, 0x01, 0x93, 0x26, 0x77, 0x2d, 0xe2, 0x7a, 0x5c, 0x10, 0xf6, 0xb8, 0x2c, + 0x7a, 0x16, 0xb3, 0x15, 0xd9, 0xe7, 0x30, 0x53, 0xc7, 0x9e, 0xa9, 0xcb, 0xf7, 0xca, 0x5c, 0x28, + 0xbe, 0xba, 0xd9, 0xba, 0xab, 0x2b, 0x3a, 0x0b, 0xbc, 0xfe, 0x16, 0x64, 0x93, 0xbb, 0x6b, 0x8e, + 0xb3, 0x41, 0xbb, 0x5d, 0xdc, 0xa1, 0x2c, 0xb6, 0x77, 0xd6, 0x53, 0xd6, 0xa1, 0x69, 0x97, 0x78, + 0xe2, 0xa3, 0x96, 0xac, 0x53, 0xb9, 0xca, 0x70, 0x0f, 0x41, 0xed, 0xd7, 0xcf, 0x47, 0x5b, 0x80, + 0x4b, 0xe5, 0xde, 0x2d, 0xc7, 0x73, 0x52, 0x43, 0xe3, 0xe5, 0xfc, 0x03, 0xcf, 0xd1, 0xdf, 0xa3, + 0xf8, 0x76, 0x2c, 0xe2, 0xd3, 0x1d, 0xf2, 0x8f, 0x86, 0x79, 0x04, 0xb3, 0xb5, 0x16, 0xce, 0x30, + 0xcf, 0xf2, 0x97, 0xff, 0x61, 0xc4, 0xe4, 0xae, 0xfc, 0x12, 0x9a, 0xa7, 0xb6, 0xfb, 0x5a, 0xdd, + 0xd5, 0x56, 0xf6, 0x47, 0xbd, 0x39, 0x04, 0x28, 0x37, 0xb5, 0x09, 0x50, 0x5a, 0xb0, 0xab, 0x03, + 0x5a, 0x0b, 0x88, 0xba, 0xf0, 0x57, 0x48, 0xce, 0x4d, 0x61, 0xa2, 0x7f, 0x2d, 0x5a, 0x03, 0xfa, + 0xfb, 0x90, 0xea, 0xed, 0x61, 0x91, 0xb9, 0xa0, 0x07, 0xe3, 0xd5, 0x87, 0xf9, 0xc6, 0x00, 0x92, + 0x0a, 0x4e, 0x6d, 0x0f, 0x87, 0xcb, 0xa5, 0x18, 0xc8, 0x35, 0x4f, 0xdb, 0xc2, 0x40, 0xcb, 0x55, + 0xa8, 0xba, 0x34, 0x34, 0x34, 0xd3, 0x54, 0x47, 0xdf, 0x45, 0xef, 0xdc, 0x75, 0xf3, 0xe0, 0x48, + 0x43, 0x87, 0x47, 0x1a, 0xfa, 0x7d, 0xa4, 0xa1, 0xcf, 0xc7, 0x5a, 0xe3, 0xf0, 0x58, 0x6b, 0xfc, + 0x3c, 0xd6, 0x1a, 0x9b, 0x2b, 0xae, 0x27, 0x22, 0x3e, 0x9b, 0xfa, 0x46, 0xc2, 0x1e, 0x10, 0xf1, + 0x86, 0xb2, 0xd7, 0x46, 0xed, 0xbb, 0x58, 0xec, 0x85, 0x84, 0x77, 0xc6, 0xe2, 0x3f, 0x93, 0x95, + 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x5b, 0xec, 0xc8, 0xbb, 0x21, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1035,8 +607,6 @@ type MsgClient interface { // parameters. The authority defaults to the x/gov module account. UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) CreatePost(ctx context.Context, in *MsgCreatePost, opts ...grpc.CallOption) (*MsgCreatePostResponse, error) - UpdateRingPostByAcp(ctx context.Context, in *MsgUpdateRingPostByAcp, opts ...grpc.CallOption) (*MsgUpdateRingPostByAcpResponse, error) - UpdateRingPostByThresholdSignature(ctx context.Context, in *MsgUpdateRingPostByThresholdSignature, opts ...grpc.CallOption) (*MsgUpdateRingPostByThresholdSignatureResponse, error) RegisterNamespace(ctx context.Context, in *MsgRegisterNamespace, opts ...grpc.CallOption) (*MsgRegisterNamespaceResponse, error) AddCollaborator(ctx context.Context, in *MsgAddCollaborator, opts ...grpc.CallOption) (*MsgAddCollaboratorResponse, error) RemoveCollaborator(ctx context.Context, in *MsgRemoveCollaborator, opts ...grpc.CallOption) (*MsgRemoveCollaboratorResponse, error) @@ -1068,36 +638,18 @@ func (c *msgClient) CreatePost(ctx context.Context, in *MsgCreatePost, opts ...g return out, nil } -func (c *msgClient) UpdateRingPostByAcp(ctx context.Context, in *MsgUpdateRingPostByAcp, opts ...grpc.CallOption) (*MsgUpdateRingPostByAcpResponse, error) { - out := new(MsgUpdateRingPostByAcpResponse) - err := c.cc.Invoke(ctx, "/sourcehub.bulletin.Msg/UpdateRingPostByAcp", in, out, opts...) +func (c *msgClient) RegisterNamespace(ctx context.Context, in *MsgRegisterNamespace, opts ...grpc.CallOption) (*MsgRegisterNamespaceResponse, error) { + out := new(MsgRegisterNamespaceResponse) + err := c.cc.Invoke(ctx, "/sourcehub.bulletin.Msg/RegisterNamespace", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *msgClient) UpdateRingPostByThresholdSignature(ctx context.Context, in *MsgUpdateRingPostByThresholdSignature, opts ...grpc.CallOption) (*MsgUpdateRingPostByThresholdSignatureResponse, error) { - out := new(MsgUpdateRingPostByThresholdSignatureResponse) - err := c.cc.Invoke(ctx, "/sourcehub.bulletin.Msg/UpdateRingPostByThresholdSignature", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) RegisterNamespace(ctx context.Context, in *MsgRegisterNamespace, opts ...grpc.CallOption) (*MsgRegisterNamespaceResponse, error) { - out := new(MsgRegisterNamespaceResponse) - err := c.cc.Invoke(ctx, "/sourcehub.bulletin.Msg/RegisterNamespace", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) AddCollaborator(ctx context.Context, in *MsgAddCollaborator, opts ...grpc.CallOption) (*MsgAddCollaboratorResponse, error) { - out := new(MsgAddCollaboratorResponse) - err := c.cc.Invoke(ctx, "/sourcehub.bulletin.Msg/AddCollaborator", in, out, opts...) +func (c *msgClient) AddCollaborator(ctx context.Context, in *MsgAddCollaborator, opts ...grpc.CallOption) (*MsgAddCollaboratorResponse, error) { + out := new(MsgAddCollaboratorResponse) + err := c.cc.Invoke(ctx, "/sourcehub.bulletin.Msg/AddCollaborator", in, out, opts...) if err != nil { return nil, err } @@ -1119,8 +671,6 @@ type MsgServer interface { // parameters. The authority defaults to the x/gov module account. UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) CreatePost(context.Context, *MsgCreatePost) (*MsgCreatePostResponse, error) - UpdateRingPostByAcp(context.Context, *MsgUpdateRingPostByAcp) (*MsgUpdateRingPostByAcpResponse, error) - UpdateRingPostByThresholdSignature(context.Context, *MsgUpdateRingPostByThresholdSignature) (*MsgUpdateRingPostByThresholdSignatureResponse, error) RegisterNamespace(context.Context, *MsgRegisterNamespace) (*MsgRegisterNamespaceResponse, error) AddCollaborator(context.Context, *MsgAddCollaborator) (*MsgAddCollaboratorResponse, error) RemoveCollaborator(context.Context, *MsgRemoveCollaborator) (*MsgRemoveCollaboratorResponse, error) @@ -1136,12 +686,6 @@ func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateP func (*UnimplementedMsgServer) CreatePost(ctx context.Context, req *MsgCreatePost) (*MsgCreatePostResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreatePost not implemented") } -func (*UnimplementedMsgServer) UpdateRingPostByAcp(ctx context.Context, req *MsgUpdateRingPostByAcp) (*MsgUpdateRingPostByAcpResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateRingPostByAcp not implemented") -} -func (*UnimplementedMsgServer) UpdateRingPostByThresholdSignature(ctx context.Context, req *MsgUpdateRingPostByThresholdSignature) (*MsgUpdateRingPostByThresholdSignatureResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateRingPostByThresholdSignature not implemented") -} func (*UnimplementedMsgServer) RegisterNamespace(ctx context.Context, req *MsgRegisterNamespace) (*MsgRegisterNamespaceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RegisterNamespace not implemented") } @@ -1192,42 +736,6 @@ func _Msg_CreatePost_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } -func _Msg_UpdateRingPostByAcp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateRingPostByAcp) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateRingPostByAcp(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/sourcehub.bulletin.Msg/UpdateRingPostByAcp", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateRingPostByAcp(ctx, req.(*MsgUpdateRingPostByAcp)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UpdateRingPostByThresholdSignature_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateRingPostByThresholdSignature) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateRingPostByThresholdSignature(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/sourcehub.bulletin.Msg/UpdateRingPostByThresholdSignature", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateRingPostByThresholdSignature(ctx, req.(*MsgUpdateRingPostByThresholdSignature)) - } - return interceptor(ctx, in, info, handler) -} - func _Msg_RegisterNamespace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgRegisterNamespace) if err := dec(in); err != nil { @@ -1295,14 +803,6 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "CreatePost", Handler: _Msg_CreatePost_Handler, }, - { - MethodName: "UpdateRingPostByAcp", - Handler: _Msg_UpdateRingPostByAcp_Handler, - }, - { - MethodName: "UpdateRingPostByThresholdSignature", - Handler: _Msg_UpdateRingPostByThresholdSignature_Handler, - }, { MethodName: "RegisterNamespace", Handler: _Msg_RegisterNamespace_Handler, @@ -1457,296 +957,6 @@ func (m *MsgCreatePostResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgUpdateRingPostByAcp) 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 *MsgUpdateRingPostByAcp) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateRingPostByAcp) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XPssInterval != nil { - { - size := m.XPssInterval.Size() - i -= size - if _, err := m.XPssInterval.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if m.XNewThreshold != nil { - { - size := m.XNewThreshold.Size() - i -= size - if _, err := m.XNewThreshold.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if len(m.NewPeerIds) > 0 { - for iNdEx := len(m.NewPeerIds) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.NewPeerIds[iNdEx]) - copy(dAtA[i:], m.NewPeerIds[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.NewPeerIds[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if len(m.Artifact) > 0 { - i -= len(m.Artifact) - copy(dAtA[i:], m.Artifact) - i = encodeVarintTx(dAtA, i, uint64(len(m.Artifact))) - i-- - dAtA[i] = 0x22 - } - if len(m.PostId) > 0 { - i -= len(m.PostId) - copy(dAtA[i:], m.PostId) - i = encodeVarintTx(dAtA, i, uint64(len(m.PostId))) - i-- - dAtA[i] = 0x1a - } - if len(m.Namespace) > 0 { - i -= len(m.Namespace) - copy(dAtA[i:], m.Namespace) - i = encodeVarintTx(dAtA, i, uint64(len(m.Namespace))) - i-- - dAtA[i] = 0x12 - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateRingPostByAcp_NewThreshold) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateRingPostByAcp_NewThreshold) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintTx(dAtA, i, uint64(m.NewThreshold)) - i-- - dAtA[i] = 0x30 - return len(dAtA) - i, nil -} -func (m *MsgUpdateRingPostByAcp_PssInterval) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateRingPostByAcp_PssInterval) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - i = encodeVarintTx(dAtA, i, uint64(m.PssInterval)) - i-- - dAtA[i] = 0x38 - return len(dAtA) - i, nil -} -func (m *MsgUpdateRingPostByAcpResponse) 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 *MsgUpdateRingPostByAcpResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateRingPostByAcpResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgUpdateRingPostByThresholdSignature) 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 *MsgUpdateRingPostByThresholdSignature) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateRingPostByThresholdSignature) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signature) > 0 { - i -= len(m.Signature) - copy(dAtA[i:], m.Signature) - i = encodeVarintTx(dAtA, i, uint64(len(m.Signature))) - i-- - dAtA[i] = 0x32 - } - if len(m.SignatureScheme) > 0 { - i -= len(m.SignatureScheme) - copy(dAtA[i:], m.SignatureScheme) - i = encodeVarintTx(dAtA, i, uint64(len(m.SignatureScheme))) - i-- - dAtA[i] = 0x2a - } - if len(m.Artifact) > 0 { - i -= len(m.Artifact) - copy(dAtA[i:], m.Artifact) - i = encodeVarintTx(dAtA, i, uint64(len(m.Artifact))) - i-- - dAtA[i] = 0x22 - } - if len(m.PostId) > 0 { - i -= len(m.PostId) - copy(dAtA[i:], m.PostId) - i = encodeVarintTx(dAtA, i, uint64(len(m.PostId))) - i-- - dAtA[i] = 0x1a - } - if len(m.Namespace) > 0 { - i -= len(m.Namespace) - copy(dAtA[i:], m.Namespace) - i = encodeVarintTx(dAtA, i, uint64(len(m.Namespace))) - i-- - dAtA[i] = 0x12 - } - if len(m.Creator) > 0 { - i -= len(m.Creator) - copy(dAtA[i:], m.Creator) - i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateRingPostByThresholdSignatureResponse) 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 *MsgUpdateRingPostByThresholdSignatureResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateRingPostByThresholdSignatureResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *RingReshareFinalizeSignDoc) 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 *RingReshareFinalizeSignDoc) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RingReshareFinalizeSignDoc) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.BlockNumberNonce != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.BlockNumberNonce)) - i-- - dAtA[i] = 0x40 - } - if len(m.FinalizedPayloadSha256) > 0 { - i -= len(m.FinalizedPayloadSha256) - copy(dAtA[i:], m.FinalizedPayloadSha256) - i = encodeVarintTx(dAtA, i, uint64(len(m.FinalizedPayloadSha256))) - i-- - dAtA[i] = 0x3a - } - if len(m.CurrentPayloadSha256) > 0 { - i -= len(m.CurrentPayloadSha256) - copy(dAtA[i:], m.CurrentPayloadSha256) - i = encodeVarintTx(dAtA, i, uint64(len(m.CurrentPayloadSha256))) - i-- - dAtA[i] = 0x32 - } - if len(m.RingPk) > 0 { - i -= len(m.RingPk) - copy(dAtA[i:], m.RingPk) - i = encodeVarintTx(dAtA, i, uint64(len(m.RingPk))) - i-- - dAtA[i] = 0x2a - } - if len(m.PostId) > 0 { - i -= len(m.PostId) - copy(dAtA[i:], m.PostId) - i = encodeVarintTx(dAtA, i, uint64(len(m.PostId))) - i-- - dAtA[i] = 0x22 - } - if len(m.Namespace) > 0 { - i -= len(m.Namespace) - copy(dAtA[i:], m.Namespace) - i = encodeVarintTx(dAtA, i, uint64(len(m.Namespace))) - i-- - dAtA[i] = 0x1a - } - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0x12 - } - if len(m.Domain) > 0 { - i -= len(m.Domain) - copy(dAtA[i:], m.Domain) - i = encodeVarintTx(dAtA, i, uint64(len(m.Domain))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *MsgRegisterNamespace) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2036,153 +1246,7 @@ func (m *MsgCreatePostResponse) Size() (n int) { return n } -func (m *MsgUpdateRingPostByAcp) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Namespace) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.PostId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Artifact) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.NewPeerIds) > 0 { - for _, s := range m.NewPeerIds { - l = len(s) - n += 1 + l + sovTx(uint64(l)) - } - } - if m.XNewThreshold != nil { - n += m.XNewThreshold.Size() - } - if m.XPssInterval != nil { - n += m.XPssInterval.Size() - } - return n -} - -func (m *MsgUpdateRingPostByAcp_NewThreshold) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovTx(uint64(m.NewThreshold)) - return n -} -func (m *MsgUpdateRingPostByAcp_PssInterval) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovTx(uint64(m.PssInterval)) - return n -} -func (m *MsgUpdateRingPostByAcpResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgUpdateRingPostByThresholdSignature) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Namespace) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.PostId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Artifact) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.SignatureScheme) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Signature) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgUpdateRingPostByThresholdSignatureResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *RingReshareFinalizeSignDoc) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Domain) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Namespace) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.PostId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.RingPk) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.CurrentPayloadSha256) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.FinalizedPayloadSha256) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.BlockNumberNonce != 0 { - n += 1 + sovTx(uint64(m.BlockNumberNonce)) - } - return n -} - -func (m *MsgRegisterNamespace) Size() (n int) { +func (m *MsgRegisterNamespace) Size() (n int) { if m == nil { return 0 } @@ -2681,897 +1745,6 @@ func (m *MsgCreatePostResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateRingPostByAcp) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateRingPostByAcp: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateRingPostByAcp: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Namespace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PostId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PostId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Artifact", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Artifact = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NewPeerIds", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NewPeerIds = append(m.NewPeerIds, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NewThreshold", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.XNewThreshold = &MsgUpdateRingPostByAcp_NewThreshold{v} - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PssInterval", wireType) - } - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.XPssInterval = &MsgUpdateRingPostByAcp_PssInterval{v} - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateRingPostByAcpResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateRingPostByAcpResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateRingPostByAcpResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateRingPostByThresholdSignature) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateRingPostByThresholdSignature: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateRingPostByThresholdSignature: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Creator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Namespace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PostId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PostId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Artifact", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Artifact = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SignatureScheme", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SignatureScheme = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) - if m.Signature == nil { - m.Signature = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateRingPostByThresholdSignatureResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateRingPostByThresholdSignatureResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateRingPostByThresholdSignatureResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RingReshareFinalizeSignDoc) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RingReshareFinalizeSignDoc: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RingReshareFinalizeSignDoc: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Domain = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Namespace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PostId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PostId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RingPk", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RingPk = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CurrentPayloadSha256", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CurrentPayloadSha256 = append(m.CurrentPayloadSha256[:0], dAtA[iNdEx:postIndex]...) - if m.CurrentPayloadSha256 == nil { - m.CurrentPayloadSha256 = []byte{} - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FinalizedPayloadSha256", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FinalizedPayloadSha256 = append(m.FinalizedPayloadSha256[:0], dAtA[iNdEx:postIndex]...) - if m.FinalizedPayloadSha256 == nil { - m.FinalizedPayloadSha256 = []byte{} - } - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockNumberNonce", wireType) - } - m.BlockNumberNonce = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlockNumberNonce |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *MsgRegisterNamespace) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/orbis/keeper/acp.go b/x/orbis/keeper/acp.go new file mode 100644 index 00000000..3033219b --- /dev/null +++ b/x/orbis/keeper/acp.go @@ -0,0 +1,72 @@ +package keeper + +import ( + "context" + + errorsmod "cosmossdk.io/errors" + coretypes "github.com/sourcenetwork/acp_core/pkg/types" + + acptypes "github.com/sourcenetwork/sourcehub/x/acp/types" + "github.com/sourcenetwork/sourcehub/x/orbis/types" +) + +func (k *Keeper) registerRingACPObject(goCtx context.Context, creator string, policyID string, ringID string) error { + _, err := k.GetAcpKeeper().DirectPolicyCmd(goCtx, &acptypes.MsgDirectPolicyCmd{ + Creator: creator, + PolicyId: policyID, + Cmd: acptypes.NewRegisterObjectCmd(coretypes.NewObject(types.ACPResourceRing, ringID)), + }) + return err +} + +func (k *Keeper) ensureRingCreatePermission(goCtx context.Context, policyID string, creatorDID string) error { + if policyID == "" { + return errorsmod.Wrap(types.ErrInvalidRing, "missing policy_id") + } + + resp, err := k.GetAcpKeeper().VerifyAccessRequest(goCtx, &acptypes.QueryVerifyAccessRequestRequest{ + PolicyId: policyID, + AccessRequest: &coretypes.AccessRequest{ + Operations: []*coretypes.Operation{ + { + Object: coretypes.NewObject(types.ACPResourceRingPolicy, policyID), + Permission: types.ACPPermissionCreateRing, + }, + }, + Actor: coretypes.NewActor(creatorDID), + }, + }) + if err != nil { + return err + } + if !resp.Valid { + return errorsmod.Wrapf(types.ErrUnauthorizedRingCreate, "actor %s cannot create rings under policy %s", creatorDID, policyID) + } + return nil +} + +func (k *Keeper) ensureRingUpdatePermission(goCtx context.Context, ring *types.Ring, updaterDID string) error { + if ring.PolicyId == "" { + return errorsmod.Wrap(types.ErrInvalidRing, "missing policy_id") + } + + resp, err := k.GetAcpKeeper().VerifyAccessRequest(goCtx, &acptypes.QueryVerifyAccessRequestRequest{ + PolicyId: ring.PolicyId, + AccessRequest: &coretypes.AccessRequest{ + Operations: []*coretypes.Operation{ + { + Object: coretypes.NewObject(types.ACPResourceRing, ring.Id), + Permission: types.ACPPermissionUpdateRing, + }, + }, + Actor: coretypes.NewActor(updaterDID), + }, + }) + if err != nil { + return err + } + if !resp.Valid { + return errorsmod.Wrapf(types.ErrUnauthorizedRingUpdate, "actor %s cannot update ring %s", updaterDID, ring.Id) + } + return nil +} diff --git a/x/orbis/keeper/grpc_query.go b/x/orbis/keeper/grpc_query.go new file mode 100644 index 00000000..7ea2ede5 --- /dev/null +++ b/x/orbis/keeper/grpc_query.go @@ -0,0 +1,150 @@ +package keeper + +import ( + "context" + + "cosmossdk.io/store/prefix" + "github.com/cosmos/cosmos-sdk/runtime" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/sourcenetwork/sourcehub/x/orbis/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +var _ types.QueryServer = &Keeper{} + +// Params query returns orbis module params. +func (k *Keeper) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil +} + +func (k *Keeper) Ring(ctx context.Context, req *types.QueryRingRequest) (*types.QueryRingResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + if req.Id == "" { + return nil, status.Error(codes.InvalidArgument, types.ErrInvalidRingId.Error()) + } + + ring := k.GetRing(ctx, req.Id) + if ring == nil { + return nil, status.Error(codes.NotFound, types.ErrRingNotFound.Error()) + } + + return &types.QueryRingResponse{Ring: ring}, nil +} + +func (k *Keeper) Rings(ctx context.Context, req *types.QueryRingsRequest) (*types.QueryRingsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.RingKeyPrefix)) + var rings []types.Ring + + pageRes, err := query.Paginate(store, req.Pagination, func(key []byte, value []byte) error { + var ring types.Ring + k.cdc.MustUnmarshal(value, &ring) + rings = append(rings, ring) + return nil + }) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryRingsResponse{Rings: rings, Pagination: pageRes}, nil +} + +func (k *Keeper) Document(ctx context.Context, req *types.QueryDocumentRequest) (*types.QueryDocumentResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + if req.Id == "" { + return nil, status.Error(codes.InvalidArgument, types.ErrInvalidDocumentId.Error()) + } + + document := k.GetDocument(ctx, req.Id) + if document == nil { + return nil, status.Error(codes.NotFound, types.ErrDocumentNotFound.Error()) + } + + return &types.QueryDocumentResponse{Document: document}, nil +} + +func (k *Keeper) Documents(ctx context.Context, req *types.QueryDocumentsRequest) (*types.QueryDocumentsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.DocumentKeyPrefix)) + var documents []types.Document + + pageRes, err := query.Paginate(store, req.Pagination, func(key []byte, value []byte) error { + var document types.Document + k.cdc.MustUnmarshal(value, &document) + documents = append(documents, document) + return nil + }) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryDocumentsResponse{Documents: documents, Pagination: pageRes}, nil +} + +func (k *Keeper) KeyDerivation(ctx context.Context, req *types.QueryKeyDerivationRequest) (*types.QueryKeyDerivationResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + if req.Id == "" { + return nil, status.Error(codes.InvalidArgument, types.ErrInvalidKeyDerivationId.Error()) + } + + keyDerivation := k.GetKeyDerivation(ctx, req.Id) + if keyDerivation == nil { + return nil, status.Error(codes.NotFound, types.ErrKeyDerivationNotFound.Error()) + } + + return &types.QueryKeyDerivationResponse{KeyDerivation: keyDerivation}, nil +} + +func (k *Keeper) NodeInfo(ctx context.Context, req *types.QueryNodeInfoRequest) (*types.QueryNodeInfoResponse, error) { + if req == nil || req.NodeKey == "" { + return nil, status.Error(codes.InvalidArgument, "node_key is required") + } + + nodeInfo := k.GetNodeInfo(ctx, req.NodeKey) + if nodeInfo == nil { + return nil, status.Error(codes.NotFound, types.ErrNodeInfoNotFound.Error()) + } + + return &types.QueryNodeInfoResponse{NodeInfo: nodeInfo}, nil +} + +func (k *Keeper) KeyDerivations(ctx context.Context, req *types.QueryKeyDerivationsRequest) (*types.QueryKeyDerivationsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.KeyDerivationKeyPrefix)) + var keyDerivations []types.KeyDerivation + + pageRes, err := query.Paginate(store, req.Pagination, func(key []byte, value []byte) error { + var keyDerivation types.KeyDerivation + k.cdc.MustUnmarshal(value, &keyDerivation) + keyDerivations = append(keyDerivations, keyDerivation) + return nil + }) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryKeyDerivationsResponse{KeyDerivations: keyDerivations, Pagination: pageRes}, nil +} diff --git a/x/orbis/keeper/keeper.go b/x/orbis/keeper/keeper.go new file mode 100644 index 00000000..ff8a0606 --- /dev/null +++ b/x/orbis/keeper/keeper.go @@ -0,0 +1,62 @@ +package keeper + +import ( + "fmt" + + "cosmossdk.io/core/store" + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + + acpkeeper "github.com/sourcenetwork/sourcehub/x/acp/keeper" + "github.com/sourcenetwork/sourcehub/x/orbis/types" +) + +type Keeper struct { + cdc codec.BinaryCodec + storeService store.KVStoreService + logger log.Logger + + authority string + + accountKeeper types.AccountKeeper + acpKeeper *acpkeeper.Keeper +} + +func NewKeeper( + cdc codec.BinaryCodec, + storeService store.KVStoreService, + logger log.Logger, + authority string, + accountKeeper types.AccountKeeper, + acpKeeper *acpkeeper.Keeper, +) Keeper { + if _, err := sdk.AccAddressFromBech32(authority); err != nil { + panic(fmt.Sprintf("invalid authority address: %s", authority)) + } + + return Keeper{ + cdc: cdc, + storeService: storeService, + logger: logger, + authority: authority, + accountKeeper: accountKeeper, + acpKeeper: acpKeeper, + } +} + +func (k *Keeper) GetAuthority() string { + return k.authority +} + +func (k *Keeper) GetAcpKeeper() *acpkeeper.Keeper { + return k.acpKeeper +} + +func (k *Keeper) Logger() log.Logger { + return k.logger.With("module", fmt.Sprintf("x/%s", types.ModuleName)) +} + +func (k *Keeper) RingBytes(ring types.Ring) ([]byte, error) { + return k.cdc.Marshal(&ring) +} diff --git a/x/orbis/keeper/msg_server.go b/x/orbis/keeper/msg_server.go new file mode 100644 index 00000000..1a8051ad --- /dev/null +++ b/x/orbis/keeper/msg_server.go @@ -0,0 +1,466 @@ +package keeper + +import ( + "context" + "encoding/hex" + "slices" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/sourcenetwork/sourcehub/x/orbis/types" +) + +var _ types.MsgServer = &Keeper{} + +// UpdateParams updates orbis module params. +func (k *Keeper) UpdateParams(ctx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + if k.GetAuthority() != req.Authority { + return nil, errorsmod.Wrapf(types.ErrInvalidSigner, "invalid authority; expected %s, got %s", k.GetAuthority(), req.Authority) + } + + if err := k.SetParams(ctx, req.Params); err != nil { + return nil, err + } + + return &types.MsgUpdateParamsResponse{}, nil +} + +func (k *Keeper) CreateRing(goCtx context.Context, msg *types.MsgCreateRing) (*types.MsgCreateRingResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + creatorDID, err := k.GetAcpKeeper().GetActorDID(ctx, msg.Creator) + if err != nil { + return nil, err + } + + pssInterval := optionalCreateRingPSSInterval(msg) + nonce := optionalCreateRingNonce(msg) + + for _, nodeKey := range msg.PeerNodeKeys { + if k.GetNodeInfo(goCtx, nodeKey) == nil { + return nil, errorsmod.Wrapf(types.ErrInvalidRing, "peer_node_key %q has no registered node info", nodeKey) + } + } + + ringID := types.GenerateRingID(msg.PeerNodeKeys, msg.Threshold, pssInterval, msg.PolicyId, nonce) + if existing := k.GetRing(goCtx, ringID); existing != nil { + return nil, types.ErrRingAlreadyExists + } + + ring := types.Ring{ + Id: ringID, + CreatorDid: creatorDID, + PeerNodeKeys: append([]string(nil), msg.PeerNodeKeys...), + Threshold: msg.Threshold, + PolicyId: msg.PolicyId, + BlockNumberNonce: 0, + } + setRingPSSInterval(&ring, pssInterval) + if err := validateRing(&ring); err != nil { + return nil, err + } + + if err := k.ensureRingCreatePermission(goCtx, msg.PolicyId, creatorDID); err != nil { + return nil, err + } + + if err := k.registerRingACPObject(goCtx, msg.Creator, msg.PolicyId, ringID); err != nil { + return nil, err + } + + k.SetRing(goCtx, ring) + + if err := ctx.EventManager().EmitTypedEvent(&types.EventRingCreated{ + RingId: ringID, + CreatorDid: creatorDID, + }); err != nil { + return nil, err + } + + return &types.MsgCreateRingResponse{RingId: ringID}, nil +} + +func (k *Keeper) FinalizeRing(goCtx context.Context, msg *types.MsgFinalizeRing) (*types.MsgFinalizeRingResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + ring := k.GetRing(goCtx, msg.RingId) + if ring == nil { + return nil, types.ErrRingNotFound + } + if ring.RingPk != "" { + return nil, types.ErrRingAlreadyFinalized + } + + signerKey, err := signerPublicKeyHex(ctx, k, msg.Creator) + if err != nil { + return nil, err + } + authorized := false + for _, nodeKey := range ring.PeerNodeKeys { + if nodeKey == signerKey { + authorized = true + break + } + } + if !authorized { + return nil, types.ErrInvalidRingFinalizer + } + + // Reject double confirmations from the same node before checking for + // pk conflicts. Without this ordering a node that already confirmed + // correctly could delete the ring by re-submitting with a different + // ring_pk — the conflict check would fire first and wipe the ring. + for _, c := range ring.Confirmations { + if c.NodeKey == signerKey { + return nil, types.ErrDuplicateConfirmation + } + } + + // Check for a conflicting ring_pk from a prior confirmation by a + // different node. This is a genuine BFT violation. + for _, c := range ring.Confirmations { + if c.RingPk != msg.RingPk { + return nil, types.ErrRingPkConflict + } + } + + ring.Confirmations = append(ring.Confirmations, &types.RingConfirmation{ + NodeKey: signerKey, + RingPk: msg.RingPk, + }) + + if len(ring.Confirmations) < len(ring.PeerNodeKeys) { + k.SetRing(goCtx, *ring) + return &types.MsgFinalizeRingResponse{}, nil + } + + // All nodes confirmed — finalize. + finalizerDID, err := k.GetAcpKeeper().GetActorDID(ctx, msg.Creator) + if err != nil { + return nil, err + } + + ring.RingPk = msg.RingPk + ring.Confirmations = nil + if err := validateRing(ring); err != nil { + return nil, err + } + + k.SetRing(goCtx, *ring) + + if err := ctx.EventManager().EmitTypedEvent(&types.EventRingUpdated{ + RingId: ring.Id, + UpdaterDid: finalizerDID, + }); err != nil { + return nil, err + } + + return &types.MsgFinalizeRingResponse{}, nil +} + +func (k *Keeper) UpdateRingByAcp(goCtx context.Context, msg *types.MsgUpdateRingByAcp) (*types.MsgUpdateRingByAcpResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + ring := k.GetRing(goCtx, msg.RingId) + if ring == nil { + return nil, types.ErrRingNotFound + } + if err := requireRingFinalized(ring); err != nil { + return nil, err + } + + updaterDID, err := k.GetAcpKeeper().GetActorDID(ctx, msg.Creator) + if err != nil { + return nil, err + } + if err := k.ensureRingUpdatePermission(goCtx, ring, updaterDID); err != nil { + return nil, err + } + + newThreshold := optionalUpdateRingNewThreshold(msg) + if err := validateRingUpdate(msg.NewPeerNodeKeys, newThreshold, ring); err != nil { + return nil, err + } + for _, nodeKey := range msg.NewPeerNodeKeys { + nodeInfo := k.GetNodeInfo(goCtx, nodeKey) + if nodeInfo == nil { + return nil, errorsmod.Wrapf(types.ErrInvalidRing, "peer_node_key %q has no registered node info", nodeKey) + } + if !nodeInfoAllowsRing(nodeInfo, ring) { + return nil, errorsmod.Wrapf( + types.ErrInvalidRing, + "peer_node_key %q is not whitelisted for policy_id %q or ring_id %q", + nodeKey, + ring.PolicyId, + ring.Id, + ) + } + } + + if len(msg.NewPeerNodeKeys) > 0 { + ring.NewPeerNodeKeys = append([]string(nil), msg.NewPeerNodeKeys...) + } + if newThreshold != nil { + setRingNewThreshold(ring, newThreshold) + } + if msg.XPssInterval != nil { + setRingPSSInterval(ring, optionalUpdateRingPSSInterval(msg)) + } + if err := validateRing(ring); err != nil { + return nil, err + } + + k.SetRing(goCtx, *ring) + + if err := ctx.EventManager().EmitTypedEvent(&types.EventRingUpdated{ + RingId: ring.Id, + UpdaterDid: updaterDID, + }); err != nil { + return nil, err + } + + return &types.MsgUpdateRingByAcpResponse{}, nil +} + +func nodeInfoAllowsRing(nodeInfo *types.NodeInfo, ring *types.Ring) bool { + return slices.Contains(nodeInfo.WhitelistedPolicyIds, ring.PolicyId) || + slices.Contains(nodeInfo.WhitelistedRingIds, ring.Id) +} + +func (k *Keeper) FinalizeRingReshareByThresholdSignature( + goCtx context.Context, + msg *types.MsgFinalizeRingReshareByThresholdSignature, +) (*types.MsgFinalizeRingReshareByThresholdSignatureResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + ring := k.GetRing(goCtx, msg.RingId) + if ring == nil { + return nil, types.ErrRingNotFound + } + + updaterDID, err := k.GetAcpKeeper().GetActorDID(ctx, msg.Creator) + if err != nil { + return nil, err + } + + signDocFinalizedRing, err := ringForReshareFinalization(ring) + if err != nil { + return nil, err + } + + signBytes, err := ringReshareFinalizeSignBytes(ctx.ChainID(), ring, signDocFinalizedRing) + if err != nil { + return nil, err + } + if err := verifyThresholdSignatureForRingUpdate(ring, signBytes, msg.SignatureScheme, msg.Signature); err != nil { + return nil, err + } + + finalizedRing := *signDocFinalizedRing + finalizedRing.BlockNumberNonce = uint64(ctx.BlockHeight()) + k.SetRing(goCtx, finalizedRing) + + if err := ctx.EventManager().EmitTypedEvent(&types.EventRingUpdated{ + RingId: finalizedRing.Id, + UpdaterDid: updaterDID, + }); err != nil { + return nil, err + } + + return &types.MsgFinalizeRingReshareByThresholdSignatureResponse{}, nil +} + +func (k *Keeper) StoreDocument(goCtx context.Context, msg *types.MsgStoreDocument) (*types.MsgStoreDocumentResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + ring := k.GetRing(goCtx, msg.RingId) + if ring == nil { + return nil, types.ErrRingNotFound + } + if err := requireRingFinalized(ring); err != nil { + return nil, err + } + + creatorDID, err := k.GetAcpKeeper().GetActorDID(ctx, msg.Creator) + if err != nil { + return nil, err + } + + tier := optionalStoreDocumentTier(msg) + timestamp := optionalStoreDocumentTimestamp(msg) + + documentID := types.GenerateDocumentID(msg.RingId, msg.Document, msg.Proof, msg.PolicyId, msg.Resource, msg.Permission, tier, timestamp) + if existing := k.GetDocument(goCtx, documentID); existing != nil { + return nil, types.ErrDocumentAlreadyExists + } + + document := types.Document{ + Id: documentID, + CreatorDid: creatorDID, + RingId: msg.RingId, + Document: msg.Document, + Proof: msg.Proof, + PolicyId: msg.PolicyId, + Resource: msg.Resource, + Permission: msg.Permission, + } + setDocumentTier(&document, tier) + setDocumentTimestamp(&document, timestamp) + if err := validateDocument(&document); err != nil { + return nil, err + } + + k.SetDocument(goCtx, document) + + if err := ctx.EventManager().EmitTypedEvent(&types.EventDocumentStored{ + DocumentId: documentID, + CreatorDid: creatorDID, + }); err != nil { + return nil, err + } + + return &types.MsgStoreDocumentResponse{DocumentId: documentID}, nil +} + +func (k *Keeper) CreateNodeInfo(goCtx context.Context, msg *types.MsgCreateNodeInfo) (*types.MsgCreateNodeInfoResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + nodeKey, err := signerPublicKeyHex(ctx, k, msg.Creator) + if err != nil { + return nil, err + } + + if existing := k.GetNodeInfo(goCtx, nodeKey); existing != nil { + return nil, types.ErrNodeInfoAlreadyExists + } + + nodeInfo := types.NodeInfo{ + PeerId: msg.PeerId, + ControllerKey: msg.ControllerKey, + WhitelistedPolicyIds: append([]string(nil), msg.WhitelistedPolicyIds...), + WhitelistedRingIds: append([]string(nil), msg.WhitelistedRingIds...), + } + if err := validateNodeInfo(&nodeInfo); err != nil { + return nil, err + } + + k.SetNodeInfo(goCtx, nodeKey, nodeInfo) + + if err := ctx.EventManager().EmitTypedEvent(&types.EventNodeInfoCreated{ + PeerId: nodeInfo.PeerId, + ControllerKey: nodeInfo.ControllerKey, + }); err != nil { + return nil, err + } + + return &types.MsgCreateNodeInfoResponse{}, nil +} + +func (k *Keeper) UpdateNodeInfo(goCtx context.Context, msg *types.MsgUpdateNodeInfo) (*types.MsgUpdateNodeInfoResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + nodeInfo := k.GetNodeInfo(goCtx, msg.NodeKey) + if nodeInfo == nil { + return nil, types.ErrNodeInfoNotFound + } + + signerKey, err := signerPublicKeyHex(ctx, k, msg.Creator) + if err != nil { + return nil, err + } + if signerKey != nodeInfo.ControllerKey { + return nil, types.ErrUnauthorizedNodeInfoUpdate + } + + if msg.XPeerId != nil { + nodeInfo.PeerId = msg.GetPeerId() + } + if msg.XControllerKey != nil { + nodeInfo.ControllerKey = msg.GetControllerKey() + } + nodeInfo.WhitelistedPolicyIds = append([]string(nil), msg.WhitelistedPolicyIds...) + nodeInfo.WhitelistedRingIds = append([]string(nil), msg.WhitelistedRingIds...) + if err := validateNodeInfo(nodeInfo); err != nil { + return nil, err + } + + k.SetNodeInfo(goCtx, msg.NodeKey, *nodeInfo) + + if err := ctx.EventManager().EmitTypedEvent(&types.EventNodeInfoUpdated{ + PeerId: nodeInfo.PeerId, + ControllerKey: nodeInfo.ControllerKey, + }); err != nil { + return nil, err + } + + return &types.MsgUpdateNodeInfoResponse{}, nil +} + +// signerPublicKeyHex returns the hex-encoded compressed public key for a bech32 address. +// The ante handler populates the account's public key before message handlers run, +// so it is guaranteed non-nil for the transaction signer. +func signerPublicKeyHex(ctx sdk.Context, k *Keeper, address string) (string, error) { + addr, err := sdk.AccAddressFromBech32(address) + if err != nil { + return "", errorsmod.Wrapf(types.ErrInvalidNodeInfo, "invalid signer address: %s", err) + } + + account := k.accountKeeper.GetAccount(ctx, addr) + if account == nil { + return "", errorsmod.Wrapf(types.ErrInvalidNodeInfo, "account not found for address %s", address) + } + + pubKey := account.GetPubKey() + if pubKey == nil { + return "", errorsmod.Wrapf(types.ErrInvalidNodeInfo, "public key not set for account %s", address) + } + + return hex.EncodeToString(pubKey.Bytes()), nil +} + +func (k *Keeper) StoreKeyDerivation(goCtx context.Context, msg *types.MsgStoreKeyDerivation) (*types.MsgStoreKeyDerivationResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + ring := k.GetRing(goCtx, msg.RingId) + if ring == nil { + return nil, types.ErrRingNotFound + } + if err := requireRingFinalized(ring); err != nil { + return nil, err + } + + creatorDID, err := k.GetAcpKeeper().GetActorDID(ctx, msg.Creator) + if err != nil { + return nil, err + } + + keyDerivationID := types.GenerateKeyDerivationID(msg.RingId, msg.Derivation, msg.PolicyId, msg.Resource, msg.Permission) + if existing := k.GetKeyDerivation(goCtx, keyDerivationID); existing != nil { + return nil, types.ErrKeyDerivationAlreadyExists + } + + keyDerivation := types.KeyDerivation{ + Id: keyDerivationID, + CreatorDid: creatorDID, + RingId: msg.RingId, + Derivation: msg.Derivation, + PolicyId: msg.PolicyId, + Resource: msg.Resource, + Permission: msg.Permission, + } + if err := validateKeyDerivation(&keyDerivation); err != nil { + return nil, err + } + + k.SetKeyDerivation(goCtx, keyDerivation) + + if err := ctx.EventManager().EmitTypedEvent(&types.EventKeyDerivationStored{ + KeyDerivationId: keyDerivationID, + CreatorDid: creatorDID, + }); err != nil { + return nil, err + } + + return &types.MsgStoreKeyDerivationResponse{KeyDerivationId: keyDerivationID}, nil +} diff --git a/x/orbis/keeper/msg_server_test.go b/x/orbis/keeper/msg_server_test.go new file mode 100644 index 00000000..977d1202 --- /dev/null +++ b/x/orbis/keeper/msg_server_test.go @@ -0,0 +1,1243 @@ +package keeper_test + +import ( + "encoding/hex" + "fmt" + "testing" + + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + sdk "github.com/cosmos/cosmos-sdk/types" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + coretypes "github.com/sourcenetwork/acp_core/pkg/types" + "github.com/stretchr/testify/require" + + appparams "github.com/sourcenetwork/sourcehub/app/params" + keepertestutil "github.com/sourcenetwork/sourcehub/testutil/keeper" + acptypes "github.com/sourcenetwork/sourcehub/x/acp/types" + "github.com/sourcenetwork/sourcehub/x/orbis/keeper" + "github.com/sourcenetwork/sourcehub/x/orbis/types" +) + +const testDID = "did:example:orbis-creator" +const testPolicyOwnerDID = "did:example:orbis-policy-owner" +const testOperatorDID = "did:example:orbis-operator" +const testOutsiderDID = "did:example:orbis-outsider" +const testPeerDID = "did:example:orbis-peer" + +const testOrbisRingPolicy = ` +name: orbis ring policy +resources: +- name: ring_policy + permissions: + - name: create_ring + expr: ring_creator + relations: + - name: ring_creator + types: + - actor +- name: ring + permissions: + - name: update_ring + expr: operator + relations: + - name: operator + types: + - actor +` + +const testNonRingPolicy = ` +name: non-ring policy +resources: +- name: file +` + +func TestMsgServer_CreateRingStoreDocumentAndKeyDerivation(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctx.WithValue(appparams.ExtractedDIDContextKey, testDID) + + creatorAddr, _ := testAccountWithPubKey(t, ctx, authKeeper) + + peer1Addr, peer1Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer1") + peer2Addr, peer2Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer2") + peer3Addr, peer3Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer3") + policyID := createOrbisRingPolicy(t, k, ctx, creatorAddr) + + pssInterval := uint64(600) + createRingResp, err := k.CreateRing(ctx, &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key, peer2Key, peer3Key}, + Threshold: 2, + PolicyId: policyID, + XPssInterval: &types.MsgCreateRing_PssInterval{ + PssInterval: pssInterval, + }, + }) + require.NoError(t, err) + + ring := k.GetRing(ctx, createRingResp.RingId) + require.NotNil(t, ring) + require.Equal(t, testDID, ring.CreatorDid) + require.Empty(t, ring.RingPk) + require.Equal(t, []string{peer1Key, peer2Key, peer3Key}, ring.PeerNodeKeys) + require.Equal(t, uint32(2), ring.Threshold) + require.Equal(t, policyID, ring.PolicyId) + require.NotNil(t, ring.XPssInterval) + require.Equal(t, pssInterval, ring.GetPssInterval()) + + // all three nodes must confirm; ring not finalized until the last one + _, err = k.FinalizeRing(ctx, &types.MsgFinalizeRing{Creator: peer1Addr, RingId: createRingResp.RingId, RingPk: "ring-pk"}) + require.NoError(t, err) + require.Empty(t, k.GetRing(ctx, createRingResp.RingId).RingPk) + + _, err = k.FinalizeRing(ctx, &types.MsgFinalizeRing{Creator: peer2Addr, RingId: createRingResp.RingId, RingPk: "ring-pk"}) + require.NoError(t, err) + require.Empty(t, k.GetRing(ctx, createRingResp.RingId).RingPk) + + _, err = k.FinalizeRing(ctx, &types.MsgFinalizeRing{Creator: peer3Addr, RingId: createRingResp.RingId, RingPk: "ring-pk"}) + require.NoError(t, err) + require.Equal(t, "ring-pk", k.GetRing(ctx, createRingResp.RingId).RingPk) + + _, err = k.FinalizeRing(ctx, &types.MsgFinalizeRing{ + Creator: peer1Addr, + RingId: createRingResp.RingId, + RingPk: "ring-pk-2", + }) + require.ErrorIs(t, err, types.ErrRingAlreadyFinalized) + + _, err = k.CreateRing(ctx, &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key, peer2Key, peer3Key}, + Threshold: 2, + PolicyId: policyID, + XPssInterval: &types.MsgCreateRing_PssInterval{ + PssInterval: pssInterval, + }, + }) + require.ErrorIs(t, err, types.ErrRingAlreadyExists) + + tier := "gold" + timestamp := uint64(42) + storeDocumentMsg := &types.MsgStoreDocument{ + Creator: creatorAddr, + RingId: createRingResp.RingId, + Document: "ciphertext", + Proof: "proof", + PolicyId: "policy-doc", + Resource: "secret", + Permission: "decrypt", + XTier: &types.MsgStoreDocument_Tier{ + Tier: tier, + }, + XTimestamp: &types.MsgStoreDocument_Timestamp{ + Timestamp: timestamp, + }, + } + storeDocumentResp, err := k.StoreDocument(ctx, storeDocumentMsg) + require.NoError(t, err) + require.Equal( + t, + types.GenerateDocumentID(createRingResp.RingId, "ciphertext", "proof", "policy-doc", "secret", "decrypt", &tier, ×tamp), + storeDocumentResp.DocumentId, + ) + + document := k.GetDocument(ctx, storeDocumentResp.DocumentId) + require.NotNil(t, document) + require.Equal(t, testDID, document.CreatorDid) + require.NotNil(t, document.XTier) + require.NotNil(t, document.XTimestamp) + require.Equal(t, tier, document.GetTier()) + require.Equal(t, timestamp, document.GetTimestamp()) + + _, err = k.StoreDocument(ctx, storeDocumentMsg) + require.ErrorIs(t, err, types.ErrDocumentAlreadyExists) + + storeKeyDerivationMsg := &types.MsgStoreKeyDerivation{ + Creator: creatorAddr, + RingId: createRingResp.RingId, + Derivation: "m/0/1", + PolicyId: "policy-derivation", + Resource: "derived-key", + Permission: "derive", + } + storeKeyDerivationResp, err := k.StoreKeyDerivation(ctx, storeKeyDerivationMsg) + require.NoError(t, err) + require.Equal( + t, + types.GenerateKeyDerivationID(createRingResp.RingId, "m/0/1", "policy-derivation", "derived-key", "derive"), + storeKeyDerivationResp.KeyDerivationId, + ) + + keyDerivation := k.GetKeyDerivation(ctx, storeKeyDerivationResp.KeyDerivationId) + require.NotNil(t, keyDerivation) + require.Equal(t, testDID, keyDerivation.CreatorDid) + require.Equal(t, "m/0/1", keyDerivation.Derivation) + + _, err = k.StoreKeyDerivation(ctx, storeKeyDerivationMsg) + require.ErrorIs(t, err, types.ErrKeyDerivationAlreadyExists) +} + +func TestMsgServer_CreateRing_NonceDisambiguatesIdenticalSettings(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctx.WithValue(appparams.ExtractedDIDContextKey, testDID) + + creatorAddr, _ := testAccountWithPubKey(t, ctx, authKeeper) + _, peer1Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer1") + policyID := createOrbisRingPolicy(t, k, ctx, creatorAddr) + + base := &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key}, + Threshold: 1, + PolicyId: policyID, + } + + // first ring — no nonce + resp1, err := k.CreateRing(ctx, base) + require.NoError(t, err) + + // identical settings without nonce clash + _, err = k.CreateRing(ctx, base) + require.ErrorIs(t, err, types.ErrRingAlreadyExists) + + // same settings but with a nonce produces a different ring_id + resp2, err := k.CreateRing(ctx, &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key}, + Threshold: 1, + PolicyId: policyID, + XNonce: &types.MsgCreateRing_Nonce{Nonce: "attempt-2"}, + }) + require.NoError(t, err) + require.NotEqual(t, resp1.RingId, resp2.RingId) + + // different nonce values produce different ring_ids + resp3, err := k.CreateRing(ctx, &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key}, + Threshold: 1, + PolicyId: policyID, + XNonce: &types.MsgCreateRing_Nonce{Nonce: "attempt-3"}, + }) + require.NoError(t, err) + require.NotEqual(t, resp2.RingId, resp3.RingId) +} + +func TestMsgServer_CreateRingRequiresPolicyID(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctx.WithValue(appparams.ExtractedDIDContextKey, testDID) + + creatorAddr, _ := testAccountWithPubKey(t, ctx, authKeeper) + _, peer1Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer1") + + _, err := k.CreateRing(ctx, &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key}, + Threshold: 1, + }) + require.ErrorIs(t, err, types.ErrInvalidRing) + require.ErrorContains(t, err, "missing policy_id") +} + +func TestMsgServer_CreateRingRequiresExistingRingPolicy(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctx.WithValue(appparams.ExtractedDIDContextKey, testDID) + + creatorAddr, _ := testAccountWithPubKey(t, ctx, authKeeper) + _, peer1Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer1") + + ringID := types.GenerateRingID([]string{peer1Key}, 1, nil, "missing-policy", nil) + _, err := k.CreateRing(ctx, &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key}, + Threshold: 1, + PolicyId: "missing-policy", + }) + require.Error(t, err) + require.Nil(t, k.GetRing(ctx, ringID)) +} + +func TestMsgServer_CreateRingRequiresRegisteredRingPolicyControlObject(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctx.WithValue(appparams.ExtractedDIDContextKey, testDID) + + creatorAddr, _ := testAccountWithPubKey(t, ctx, authKeeper) + _, peer1Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer1") + policyID := createACPPolicy(t, k, ctx, creatorAddr, testOrbisRingPolicy) + + ringID := types.GenerateRingID([]string{peer1Key}, 1, nil, policyID, nil) + _, err := k.CreateRing(ctx, &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key}, + Threshold: 1, + PolicyId: policyID, + }) + require.ErrorIs(t, err, types.ErrUnauthorizedRingCreate) + require.Nil(t, k.GetRing(ctx, ringID)) +} + +func TestMsgServer_CreateRingRequiresPolicyWithRingResource(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctx.WithValue(appparams.ExtractedDIDContextKey, testDID) + + creatorAddr, _ := testAccountWithPubKey(t, ctx, authKeeper) + _, peer1Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer1") + policyID := createACPPolicy(t, k, ctx, creatorAddr, testNonRingPolicy) + + ringID := types.GenerateRingID([]string{peer1Key}, 1, nil, policyID, nil) + _, err := k.CreateRing(ctx, &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key}, + Threshold: 1, + PolicyId: policyID, + }) + require.Error(t, err) + require.Nil(t, k.GetRing(ctx, ringID)) +} + +func TestMsgServer_CreateRingRejectsActorWithoutCreatePermission(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + policyOwnerCtx := ctxWithDID(ctx, testPolicyOwnerDID) + creatorCtx := ctxWithDID(ctx, testDID) + + policyOwnerAddr, _ := testAccountWithPubKey(t, policyOwnerCtx, authKeeper) + creatorAddr, _ := testAccountWithPubKey(t, creatorCtx, authKeeper) + _, peer1Key := setupPeerWithNodeInfo(t, k, authKeeper, policyOwnerCtx, "12D3KooWPeer1") + policyID := createOrbisRingPolicy(t, k, policyOwnerCtx, policyOwnerAddr) + + ringID := types.GenerateRingID([]string{peer1Key}, 1, nil, policyID, nil) + _, err := k.CreateRing(creatorCtx, &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key}, + Threshold: 1, + PolicyId: policyID, + }) + require.ErrorIs(t, err, types.ErrUnauthorizedRingCreate) + require.Nil(t, k.GetRing(creatorCtx, ringID)) +} + +func TestMsgServer_CreateRingAllowsRingCreatorRelation(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + policyOwnerCtx := ctxWithDID(ctx, testPolicyOwnerDID) + creatorCtx := ctxWithDID(ctx, testDID) + + policyOwnerAddr, _ := testAccountWithPubKey(t, policyOwnerCtx, authKeeper) + creatorAddr, _ := testAccountWithPubKey(t, creatorCtx, authKeeper) + _, peer1Key := setupPeerWithNodeInfo(t, k, authKeeper, policyOwnerCtx, "12D3KooWPeer1") + policyID := createOrbisRingPolicy(t, k, policyOwnerCtx, policyOwnerAddr) + grantRingCreator(t, k, policyOwnerCtx, policyOwnerAddr, policyID, testDID) + + createRingResp, err := k.CreateRing(creatorCtx, &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key}, + Threshold: 1, + PolicyId: policyID, + }) + require.NoError(t, err) + + ring := k.GetRing(creatorCtx, createRingResp.RingId) + require.NotNil(t, ring) + require.Equal(t, testDID, ring.CreatorDid) + + ownerResp, err := k.GetAcpKeeper().ObjectOwner(creatorCtx, &acptypes.QueryObjectOwnerRequest{ + PolicyId: policyID, + Object: coretypes.NewObject(types.ACPResourceRing, createRingResp.RingId), + }) + require.NoError(t, err) + require.True(t, ownerResp.IsRegistered) + require.Equal(t, testDID, ownerResp.Record.Metadata.OwnerDid) +} + +func TestMsgServer_CreateRingRegistersACPObject(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctx.WithValue(appparams.ExtractedDIDContextKey, testDID) + + creatorAddr, _ := testAccountWithPubKey(t, ctx, authKeeper) + _, peer1Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer1") + policyID := createOrbisRingPolicy(t, k, ctx, creatorAddr) + + createRingResp, err := k.CreateRing(ctx, &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key}, + Threshold: 1, + PolicyId: policyID, + }) + require.NoError(t, err) + + ownerResp, err := k.GetAcpKeeper().ObjectOwner(ctx, &acptypes.QueryObjectOwnerRequest{ + PolicyId: policyID, + Object: coretypes.NewObject(types.ACPResourceRing, createRingResp.RingId), + }) + require.NoError(t, err) + require.True(t, ownerResp.IsRegistered) + require.NotNil(t, ownerResp.Record) +} + +func TestMsgServer_FinalizeRing_UnauthorizedNonPeer(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctx.WithValue(appparams.ExtractedDIDContextKey, testDID) + + creatorAddr, _ := testAccountWithPubKey(t, ctx, authKeeper) + + _, peer1Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer1") + _, peer2Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer2") + policyID := createOrbisRingPolicy(t, k, ctx, creatorAddr) + + createRingResp, err := k.CreateRing(ctx, &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key, peer2Key}, + Threshold: 1, + PolicyId: policyID, + }) + require.NoError(t, err) + + outsiderAddr, _ := testAccountWithPubKey(t, ctx, authKeeper) + _, err = k.FinalizeRing(ctx, &types.MsgFinalizeRing{ + Creator: outsiderAddr, + RingId: createRingResp.RingId, + RingPk: "ring-pk", + }) + require.ErrorIs(t, err, types.ErrInvalidRingFinalizer) +} + +func TestMsgServer_FinalizeRing_RequiresAllNodes(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctx.WithValue(appparams.ExtractedDIDContextKey, testDID) + + creatorAddr, _ := testAccountWithPubKey(t, ctx, authKeeper) + + peer1Addr, peer1Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer1") + peer2Addr, peer2Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer2") + peer3Addr, peer3Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer3") + policyID := createOrbisRingPolicy(t, k, ctx, creatorAddr) + + createRingResp, err := k.CreateRing(ctx, &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key, peer2Key, peer3Key}, + Threshold: 2, + PolicyId: policyID, + }) + require.NoError(t, err) + ringID := createRingResp.RingId + + // first confirmation — not finalized + _, err = k.FinalizeRing(ctx, &types.MsgFinalizeRing{Creator: peer1Addr, RingId: ringID, RingPk: "agreed-pk"}) + require.NoError(t, err) + require.Empty(t, k.GetRing(ctx, ringID).RingPk) + require.Len(t, k.GetRing(ctx, ringID).Confirmations, 1) + + // second confirmation — threshold=2 is met but not all nodes, so still not finalized + _, err = k.FinalizeRing(ctx, &types.MsgFinalizeRing{Creator: peer2Addr, RingId: ringID, RingPk: "agreed-pk"}) + require.NoError(t, err) + require.Empty(t, k.GetRing(ctx, ringID).RingPk) + require.Len(t, k.GetRing(ctx, ringID).Confirmations, 2) + + // third confirmation — all nodes confirmed → finalized, confirmations cleared + _, err = k.FinalizeRing(ctx, &types.MsgFinalizeRing{Creator: peer3Addr, RingId: ringID, RingPk: "agreed-pk"}) + require.NoError(t, err) + ring := k.GetRing(ctx, ringID) + require.Equal(t, "agreed-pk", ring.RingPk) + require.Empty(t, ring.Confirmations) + + // any further confirmation must fail + _, err = k.FinalizeRing(ctx, &types.MsgFinalizeRing{Creator: peer1Addr, RingId: ringID, RingPk: "agreed-pk"}) + require.ErrorIs(t, err, types.ErrRingAlreadyFinalized) +} + +func TestMsgServer_FinalizeRing_PkConflictRejected(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctx.WithValue(appparams.ExtractedDIDContextKey, testDID) + + creatorAddr, _ := testAccountWithPubKey(t, ctx, authKeeper) + + peer1Addr, peer1Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer1") + peer2Addr, peer2Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer2") + policyID := createOrbisRingPolicy(t, k, ctx, creatorAddr) + + createRingResp, err := k.CreateRing(ctx, &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key, peer2Key}, + Threshold: 2, + PolicyId: policyID, + }) + require.NoError(t, err) + ringID := createRingResp.RingId + + _, err = k.FinalizeRing(ctx, &types.MsgFinalizeRing{Creator: peer1Addr, RingId: ringID, RingPk: "pk-version-A"}) + require.NoError(t, err) + + // peer2 disagrees on the ring_pk -> conflict rejected, ring remains + _, err = k.FinalizeRing(ctx, &types.MsgFinalizeRing{Creator: peer2Addr, RingId: ringID, RingPk: "pk-version-B"}) + require.ErrorIs(t, err, types.ErrRingPkConflict) + require.NotNil(t, k.GetRing(ctx, ringID)) +} + +func TestMsgServer_FinalizeRing_DuplicateConfirmationRejected(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctx.WithValue(appparams.ExtractedDIDContextKey, testDID) + + creatorAddr, _ := testAccountWithPubKey(t, ctx, authKeeper) + + peer1Addr, peer1Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer1") + _, peer2Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer2") + policyID := createOrbisRingPolicy(t, k, ctx, creatorAddr) + + createRingResp, err := k.CreateRing(ctx, &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key, peer2Key}, + Threshold: 2, + PolicyId: policyID, + }) + require.NoError(t, err) + ringID := createRingResp.RingId + + _, err = k.FinalizeRing(ctx, &types.MsgFinalizeRing{Creator: peer1Addr, RingId: ringID, RingPk: "ring-pk"}) + require.NoError(t, err) + + _, err = k.FinalizeRing(ctx, &types.MsgFinalizeRing{Creator: peer1Addr, RingId: ringID, RingPk: "ring-pk"}) + require.ErrorIs(t, err, types.ErrDuplicateConfirmation) +} + +func TestMsgServer_RingNotFinalizedGuard(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctx.WithValue(appparams.ExtractedDIDContextKey, testDID) + + creatorAddr, _ := testAccountWithPubKey(t, ctx, authKeeper) + + _, peer1Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer1") + policyID := createOrbisRingPolicy(t, k, ctx, creatorAddr) + + createRingResp, err := k.CreateRing(ctx, &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key}, + Threshold: 1, + PolicyId: policyID, + }) + require.NoError(t, err) + ringID := createRingResp.RingId + + _, err = k.StoreDocument(ctx, &types.MsgStoreDocument{ + Creator: creatorAddr, + RingId: ringID, + Document: "ciphertext", + Proof: "proof", + PolicyId: "p", + Resource: "r", + Permission: "read", + }) + require.ErrorIs(t, err, types.ErrRingNotFinalized) + + _, err = k.StoreKeyDerivation(ctx, &types.MsgStoreKeyDerivation{ + Creator: creatorAddr, + RingId: ringID, + Derivation: "m/0/1", + PolicyId: "p", + Resource: "r", + Permission: "derive", + }) + require.ErrorIs(t, err, types.ErrRingNotFinalized) +} + +func TestMsgServer_AbsentOptionalFieldsAreTreatedAsNone(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctx.WithValue(appparams.ExtractedDIDContextKey, testDID) + + creatorAddr, _ := testAccountWithPubKey(t, ctx, authKeeper) + + peer1Addr, peer1Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer1") + peer2Addr, peer2Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer2") + policyID := createOrbisRingPolicy(t, k, ctx, creatorAddr) + + createRingResp, err := k.CreateRing(ctx, &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key, peer2Key}, + Threshold: 1, + PolicyId: policyID, + }) + require.NoError(t, err) + require.Equal( + t, + types.GenerateRingID([]string{peer1Key, peer2Key}, 1, nil, policyID, nil), + createRingResp.RingId, + ) + + _, err = k.FinalizeRing(ctx, &types.MsgFinalizeRing{Creator: peer1Addr, RingId: createRingResp.RingId, RingPk: "ring-pk"}) + require.NoError(t, err) + _, err = k.FinalizeRing(ctx, &types.MsgFinalizeRing{Creator: peer2Addr, RingId: createRingResp.RingId, RingPk: "ring-pk"}) + require.NoError(t, err) + + storeDocumentResp, err := k.StoreDocument(ctx, &types.MsgStoreDocument{ + Creator: creatorAddr, + RingId: createRingResp.RingId, + Document: "ciphertext", + Proof: "proof", + PolicyId: "policy-doc", + Resource: "secret", + Permission: "decrypt", + }) + require.NoError(t, err) + require.Equal( + t, + types.GenerateDocumentID(createRingResp.RingId, "ciphertext", "proof", "policy-doc", "secret", "decrypt", nil, nil), + storeDocumentResp.DocumentId, + ) +} + +func TestMsgServer_ZeroPSSIntervalIsPreservedWhenPresent(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctx.WithValue(appparams.ExtractedDIDContextKey, testDID) + + creatorAddr, _ := testAccountWithPubKey(t, ctx, authKeeper) + pssInterval := uint64(0) + + _, peer1Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer1") + _, peer2Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer2") + policyID := createOrbisRingPolicy(t, k, ctx, creatorAddr) + + createRingResp, err := k.CreateRing(ctx, &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key, peer2Key}, + Threshold: 1, + PolicyId: policyID, + XPssInterval: &types.MsgCreateRing_PssInterval{ + PssInterval: pssInterval, + }, + }) + require.NoError(t, err) + require.Equal( + t, + types.GenerateRingID([]string{peer1Key, peer2Key}, 1, &pssInterval, policyID, nil), + createRingResp.RingId, + ) + + ring := k.GetRing(ctx, createRingResp.RingId) + require.NotNil(t, ring) + require.NotNil(t, ring.XPssInterval) + require.Equal(t, pssInterval, ring.GetPssInterval()) +} + +func TestMsgServer_UpdateRingByAcpAllowsRingOwner(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctxWithDID(ctx, testDID) + + creatorAddr, _ := testAccountWithPubKey(t, ctx, authKeeper) + + peer1Addr, peer1Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer1") + peer2Addr, peer2Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer2") + policyID := createOrbisRingPolicy(t, k, ctx, creatorAddr) + + createRingResp, err := k.CreateRing(ctx, &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key, peer2Key}, + Threshold: 1, + PolicyId: policyID, + }) + require.NoError(t, err) + + _, err = k.FinalizeRing(ctx, &types.MsgFinalizeRing{Creator: peer1Addr, RingId: createRingResp.RingId, RingPk: "ring-pk"}) + require.NoError(t, err) + _, err = k.FinalizeRing(ctx, &types.MsgFinalizeRing{Creator: peer2Addr, RingId: createRingResp.RingId, RingPk: "ring-pk"}) + require.NoError(t, err) + + pssInterval := uint64(900) + _, err = k.UpdateRingByAcp(ctx, &types.MsgUpdateRingByAcp{ + Creator: creatorAddr, + RingId: createRingResp.RingId, + XPssInterval: &types.MsgUpdateRingByAcp_PssInterval{ + PssInterval: pssInterval, + }, + }) + require.NoError(t, err) + + ring := k.GetRing(ctx, createRingResp.RingId) + require.NotNil(t, ring) + require.Equal(t, policyID, ring.PolicyId) + require.Equal(t, pssInterval, ring.GetPssInterval()) +} + +func TestMsgServer_UpdateRingByAcpRejectsThresholdOnlyAboveExistingCommitteeSize(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctxWithDID(ctx, testDID) + + creatorAddr, _ := testAccountWithPubKey(t, ctx, authKeeper) + + peer1Addr, peer1Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer1") + peer2Addr, peer2Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer2") + policyID := createOrbisRingPolicy(t, k, ctx, creatorAddr) + + createRingResp, err := k.CreateRing(ctx, &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key, peer2Key}, + Threshold: 1, + PolicyId: policyID, + }) + require.NoError(t, err) + + _, err = k.FinalizeRing(ctx, &types.MsgFinalizeRing{Creator: peer1Addr, RingId: createRingResp.RingId, RingPk: "ring-pk"}) + require.NoError(t, err) + _, err = k.FinalizeRing(ctx, &types.MsgFinalizeRing{Creator: peer2Addr, RingId: createRingResp.RingId, RingPk: "ring-pk"}) + require.NoError(t, err) + + _, err = k.UpdateRingByAcp(ctx, &types.MsgUpdateRingByAcp{ + Creator: creatorAddr, + RingId: createRingResp.RingId, + XNewThreshold: &types.MsgUpdateRingByAcp_NewThreshold{ + NewThreshold: 3, + }, + }) + require.ErrorIs(t, err, types.ErrInvalidRing) + require.ErrorContains(t, err, "new_threshold (3) cannot exceed existing committee size (2)") + + ring := k.GetRing(ctx, createRingResp.RingId) + require.NotNil(t, ring) + require.Nil(t, ring.XNewThreshold) +} + +func TestMsgServer_UpdateRingByAcpRejectsNewPeerWithoutNodeInfo(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctxWithDID(ctx, testDID) + + creatorAddr, _ := testAccountWithPubKey(t, ctx, authKeeper) + + peer1Addr, peer1Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer1") + peer2Addr, peer2Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer2") + policyID := createOrbisRingPolicy(t, k, ctx, creatorAddr) + + createRingResp, err := k.CreateRing(ctx, &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key, peer2Key}, + Threshold: 1, + PolicyId: policyID, + }) + require.NoError(t, err) + + _, err = k.FinalizeRing(ctx, &types.MsgFinalizeRing{Creator: peer1Addr, RingId: createRingResp.RingId, RingPk: "ring-pk"}) + require.NoError(t, err) + _, err = k.FinalizeRing(ctx, &types.MsgFinalizeRing{Creator: peer2Addr, RingId: createRingResp.RingId, RingPk: "ring-pk"}) + require.NoError(t, err) + + _, missingNodeInfoKey := testAccountWithPubKey(t, ctx, authKeeper) + _, err = k.UpdateRingByAcp(ctx, &types.MsgUpdateRingByAcp{ + Creator: creatorAddr, + RingId: createRingResp.RingId, + NewPeerNodeKeys: []string{missingNodeInfoKey}, + XNewThreshold: &types.MsgUpdateRingByAcp_NewThreshold{ + NewThreshold: 1, + }, + }) + require.ErrorIs(t, err, types.ErrInvalidRing) + require.ErrorContains(t, err, fmt.Sprintf("peer_node_key %q has no registered node info", missingNodeInfoKey)) + + ring := k.GetRing(ctx, createRingResp.RingId) + require.NotNil(t, ring) + require.Empty(t, ring.NewPeerNodeKeys) + require.Nil(t, ring.XNewThreshold) +} + +func TestMsgServer_UpdateRingByAcpRejectsNewPeerWithoutRingWhitelist(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctxWithDID(ctx, testDID) + + creatorAddr, _ := testAccountWithPubKey(t, ctx, authKeeper) + + peer1Addr, peer1Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer1") + peer2Addr, peer2Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer2") + policyID := createOrbisRingPolicy(t, k, ctx, creatorAddr) + + createRingResp, err := k.CreateRing(ctx, &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key, peer2Key}, + Threshold: 1, + PolicyId: policyID, + }) + require.NoError(t, err) + + _, err = k.FinalizeRing(ctx, &types.MsgFinalizeRing{Creator: peer1Addr, RingId: createRingResp.RingId, RingPk: "ring-pk"}) + require.NoError(t, err) + _, err = k.FinalizeRing(ctx, &types.MsgFinalizeRing{Creator: peer2Addr, RingId: createRingResp.RingId, RingPk: "ring-pk"}) + require.NoError(t, err) + + _, peer3Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer3") + _, err = k.UpdateRingByAcp(ctx, &types.MsgUpdateRingByAcp{ + Creator: creatorAddr, + RingId: createRingResp.RingId, + NewPeerNodeKeys: []string{peer3Key}, + XNewThreshold: &types.MsgUpdateRingByAcp_NewThreshold{ + NewThreshold: 1, + }, + }) + require.ErrorIs(t, err, types.ErrInvalidRing) + require.ErrorContains( + t, + err, + fmt.Sprintf("peer_node_key %q is not whitelisted for policy_id %q or ring_id %q", peer3Key, policyID, createRingResp.RingId), + ) + + ring := k.GetRing(ctx, createRingResp.RingId) + require.NotNil(t, ring) + require.Empty(t, ring.NewPeerNodeKeys) + require.Nil(t, ring.XNewThreshold) +} + +func TestMsgServer_UpdateRingByAcpRejectsUnauthorizedActor(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + creatorCtx := ctxWithDID(ctx, testDID) + peerCtx := ctxWithDID(ctx, testPeerDID) + outsiderCtx := ctxWithDID(ctx, testOutsiderDID) + + creatorAddr, _ := testAccountWithPubKey(t, creatorCtx, authKeeper) + + peer1Addr, peer1Key := setupPeerWithNodeInfo(t, k, authKeeper, creatorCtx, "12D3KooWPeer1") + peer2Addr, peer2Key := setupPeerWithNodeInfo(t, k, authKeeper, creatorCtx, "12D3KooWPeer2") + policyID := createOrbisRingPolicy(t, k, creatorCtx, creatorAddr) + + createRingResp, err := k.CreateRing(creatorCtx, &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key, peer2Key}, + Threshold: 1, + PolicyId: policyID, + }) + require.NoError(t, err) + + _, err = k.FinalizeRing(peerCtx, &types.MsgFinalizeRing{Creator: peer1Addr, RingId: createRingResp.RingId, RingPk: "ring-pk"}) + require.NoError(t, err) + _, err = k.FinalizeRing(peerCtx, &types.MsgFinalizeRing{Creator: peer2Addr, RingId: createRingResp.RingId, RingPk: "ring-pk"}) + require.NoError(t, err) + + outsiderAddr, _ := testAccountWithPubKey(t, outsiderCtx, authKeeper) + _, err = k.UpdateRingByAcp(outsiderCtx, &types.MsgUpdateRingByAcp{ + Creator: outsiderAddr, + RingId: createRingResp.RingId, + XPssInterval: &types.MsgUpdateRingByAcp_PssInterval{ + PssInterval: 900, + }, + }) + require.ErrorIs(t, err, types.ErrUnauthorizedRingUpdate) + + ring := k.GetRing(creatorCtx, createRingResp.RingId) + require.NotNil(t, ring) + require.Nil(t, ring.XPssInterval) +} + +func TestMsgServer_UpdateRingByAcpUsesRingPolicy(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + creatorCtx := ctxWithDID(ctx, testDID) + peerCtx := ctxWithDID(ctx, testPeerDID) + operatorCtx := ctxWithDID(ctx, testOperatorDID) + + creatorAddr, _ := testAccountWithPubKey(t, creatorCtx, authKeeper) + + peer1Addr, peer1Key := setupPeerWithNodeInfo(t, k, authKeeper, creatorCtx, "12D3KooWPeer1") + peer2Addr, peer2Key := setupPeerWithNodeInfo(t, k, authKeeper, creatorCtx, "12D3KooWPeer2") + policyID := createOrbisRingPolicy(t, k, creatorCtx, creatorAddr) + + createRingResp, err := k.CreateRing(creatorCtx, &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key, peer2Key}, + Threshold: 1, + PolicyId: policyID, + }) + require.NoError(t, err) + + _, err = k.FinalizeRing(peerCtx, &types.MsgFinalizeRing{Creator: peer1Addr, RingId: createRingResp.RingId, RingPk: "ring-pk"}) + require.NoError(t, err) + _, err = k.FinalizeRing(peerCtx, &types.MsgFinalizeRing{Creator: peer2Addr, RingId: createRingResp.RingId, RingPk: "ring-pk"}) + require.NoError(t, err) + + operatorAddr, _ := testAccountWithPubKey(t, operatorCtx, authKeeper) + otherPolicyID := createOrbisRingPolicy(t, k, creatorCtx, creatorAddr) + _, err = k.GetAcpKeeper().DirectPolicyCmd(creatorCtx, &acptypes.MsgDirectPolicyCmd{ + Creator: creatorAddr, + PolicyId: otherPolicyID, + Cmd: acptypes.NewRegisterObjectCmd(coretypes.NewObject(types.ACPResourceRing, createRingResp.RingId)), + }) + require.NoError(t, err) + _, err = k.GetAcpKeeper().DirectPolicyCmd(creatorCtx, &acptypes.MsgDirectPolicyCmd{ + Creator: creatorAddr, + PolicyId: otherPolicyID, + Cmd: acptypes.NewSetRelationshipCmd(coretypes.NewActorRelationship( + types.ACPResourceRing, + createRingResp.RingId, + types.ACPRelationOperator, + testOperatorDID, + )), + }) + require.NoError(t, err) + + _, err = k.UpdateRingByAcp(operatorCtx, &types.MsgUpdateRingByAcp{ + Creator: operatorAddr, + RingId: createRingResp.RingId, + XPssInterval: &types.MsgUpdateRingByAcp_PssInterval{ + PssInterval: 900, + }, + }) + require.ErrorIs(t, err, types.ErrUnauthorizedRingUpdate) + require.Equal(t, policyID, k.GetRing(creatorCtx, createRingResp.RingId).PolicyId) +} + +func TestMsgServer_UpdateRingByAcpAllowsOperatorRelation(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + creatorCtx := ctxWithDID(ctx, testDID) + peerCtx := ctxWithDID(ctx, testPeerDID) + operatorCtx := ctxWithDID(ctx, testOperatorDID) + + creatorAddr, _ := testAccountWithPubKey(t, creatorCtx, authKeeper) + + peer1Addr, peer1Key := setupPeerWithNodeInfo(t, k, authKeeper, creatorCtx, "12D3KooWPeer1") + peer2Addr, peer2Key := setupPeerWithNodeInfo(t, k, authKeeper, creatorCtx, "12D3KooWPeer2") + policyID := createOrbisRingPolicy(t, k, creatorCtx, creatorAddr) + + createRingResp, err := k.CreateRing(creatorCtx, &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key, peer2Key}, + Threshold: 1, + PolicyId: policyID, + }) + require.NoError(t, err) + + _, err = k.FinalizeRing(peerCtx, &types.MsgFinalizeRing{Creator: peer1Addr, RingId: createRingResp.RingId, RingPk: "ring-pk"}) + require.NoError(t, err) + _, err = k.FinalizeRing(peerCtx, &types.MsgFinalizeRing{Creator: peer2Addr, RingId: createRingResp.RingId, RingPk: "ring-pk"}) + require.NoError(t, err) + + operatorAddr, _ := testAccountWithPubKey(t, operatorCtx, authKeeper) + _, err = k.GetAcpKeeper().DirectPolicyCmd(creatorCtx, &acptypes.MsgDirectPolicyCmd{ + Creator: creatorAddr, + PolicyId: policyID, + Cmd: acptypes.NewSetRelationshipCmd(coretypes.NewActorRelationship( + types.ACPResourceRing, + createRingResp.RingId, + types.ACPRelationOperator, + testOperatorDID, + )), + }) + require.NoError(t, err) + + peer3Addr, peer3Key := setupPeerWithNodeInfo(t, k, authKeeper, creatorCtx, "12D3KooWPeer3") + peer4Addr, peer4Key := setupPeerWithNodeInfo(t, k, authKeeper, creatorCtx, "12D3KooWPeer4") + updatePeerNodeWhitelists(t, k, creatorCtx, peer3Addr, peer3Key, []string{policyID}, nil) + updatePeerNodeWhitelists(t, k, creatorCtx, peer4Addr, peer4Key, nil, []string{createRingResp.RingId}) + _, err = k.UpdateRingByAcp(operatorCtx, &types.MsgUpdateRingByAcp{ + Creator: operatorAddr, + RingId: createRingResp.RingId, + NewPeerNodeKeys: []string{peer3Key, peer4Key}, + XNewThreshold: &types.MsgUpdateRingByAcp_NewThreshold{ + NewThreshold: 1, + }, + }) + require.NoError(t, err) + + ring := k.GetRing(creatorCtx, createRingResp.RingId) + require.NotNil(t, ring) + require.Equal(t, policyID, ring.PolicyId) + require.Equal(t, []string{peer3Key, peer4Key}, ring.NewPeerNodeKeys) + require.Equal(t, uint32(1), ring.GetNewThreshold()) +} + +func TestMsgServer_FinalizeRingReshareRequiresPendingUpdate(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctx.WithValue(appparams.ExtractedDIDContextKey, testDID) + + creatorAddr, _ := testAccountWithPubKey(t, ctx, authKeeper) + + _, peer1Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer1") + _, peer2Key := setupPeerWithNodeInfo(t, k, authKeeper, ctx, "12D3KooWPeer2") + policyID := createOrbisRingPolicy(t, k, ctx, creatorAddr) + + createRingResp, err := k.CreateRing(ctx, &types.MsgCreateRing{ + Creator: creatorAddr, + PeerNodeKeys: []string{peer1Key, peer2Key}, + Threshold: 1, + PolicyId: policyID, + }) + require.NoError(t, err) + + outsiderAddr, _ := testAccountWithPubKey(t, ctx, authKeeper) + _, err = k.FinalizeRingReshareByThresholdSignature(ctx, &types.MsgFinalizeRingReshareByThresholdSignature{ + Creator: outsiderAddr, + RingId: createRingResp.RingId, + SignatureScheme: "bls12_381", + Signature: []byte("signature"), + }) + require.ErrorIs(t, err, types.ErrInvalidRing) + require.ErrorContains(t, err, "missing new_peer_node_keys or new_threshold") +} + +func TestMsgServer_CreateNodeInfo(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctx.WithValue(appparams.ExtractedDIDContextKey, testDID) + + nodeAddr, nodePubKeyHex := testAccountWithPubKey(t, ctx, authKeeper) + _, controllerPubKeyHex := testAccountWithPubKey(t, ctx, authKeeper) + + _, err := k.CreateNodeInfo(ctx, &types.MsgCreateNodeInfo{ + Creator: nodeAddr, + PeerId: "12D3KooWExamplePeerID", + ControllerKey: controllerPubKeyHex, + }) + require.NoError(t, err) + + nodeInfo := k.GetNodeInfo(ctx, nodePubKeyHex) + require.NotNil(t, nodeInfo) + require.Equal(t, "12D3KooWExamplePeerID", nodeInfo.PeerId) + require.Equal(t, controllerPubKeyHex, nodeInfo.ControllerKey) + require.Empty(t, nodeInfo.WhitelistedPolicyIds) + require.Empty(t, nodeInfo.WhitelistedRingIds) +} + +func TestMsgServer_CreateNodeInfo_WithWhitelists(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctx.WithValue(appparams.ExtractedDIDContextKey, testDID) + + nodeAddr, nodePubKeyHex := testAccountWithPubKey(t, ctx, authKeeper) + _, controllerPubKeyHex := testAccountWithPubKey(t, ctx, authKeeper) + + _, err := k.CreateNodeInfo(ctx, &types.MsgCreateNodeInfo{ + Creator: nodeAddr, + PeerId: "peer-1", + ControllerKey: controllerPubKeyHex, + WhitelistedPolicyIds: []string{"policy-a", "policy-b"}, + WhitelistedRingIds: []string{"ring-1"}, + }) + require.NoError(t, err) + + nodeInfo := k.GetNodeInfo(ctx, nodePubKeyHex) + require.NotNil(t, nodeInfo) + require.Equal(t, []string{"policy-a", "policy-b"}, nodeInfo.WhitelistedPolicyIds) + require.Equal(t, []string{"ring-1"}, nodeInfo.WhitelistedRingIds) +} + +func TestMsgServer_CreateNodeInfo_AlreadyExists(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctx.WithValue(appparams.ExtractedDIDContextKey, testDID) + + nodeAddr, _ := testAccountWithPubKey(t, ctx, authKeeper) + _, controllerPubKeyHex := testAccountWithPubKey(t, ctx, authKeeper) + + msg := &types.MsgCreateNodeInfo{ + Creator: nodeAddr, + PeerId: "peer-1", + ControllerKey: controllerPubKeyHex, + } + + _, err := k.CreateNodeInfo(ctx, msg) + require.NoError(t, err) + + _, err = k.CreateNodeInfo(ctx, msg) + require.ErrorIs(t, err, types.ErrNodeInfoAlreadyExists) +} + +func TestMsgServer_UpdateNodeInfo(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctx.WithValue(appparams.ExtractedDIDContextKey, testDID) + + nodeAddr, nodePubKeyHex := testAccountWithPubKey(t, ctx, authKeeper) + controllerAddr, controllerPubKeyHex := testAccountWithPubKey(t, ctx, authKeeper) + + _, err := k.CreateNodeInfo(ctx, &types.MsgCreateNodeInfo{ + Creator: nodeAddr, + PeerId: "peer-original", + ControllerKey: controllerPubKeyHex, + WhitelistedPolicyIds: []string{"policy-a"}, + }) + require.NoError(t, err) + + _, err = k.UpdateNodeInfo(ctx, &types.MsgUpdateNodeInfo{ + Creator: controllerAddr, + NodeKey: nodePubKeyHex, + WhitelistedPolicyIds: []string{"policy-b", "policy-c"}, + WhitelistedRingIds: []string{"ring-1", "ring-2"}, + }) + require.NoError(t, err) + + nodeInfo := k.GetNodeInfo(ctx, nodePubKeyHex) + require.NotNil(t, nodeInfo) + require.Equal(t, "peer-original", nodeInfo.PeerId) + require.Equal(t, []string{"policy-b", "policy-c"}, nodeInfo.WhitelistedPolicyIds) + require.Equal(t, []string{"ring-1", "ring-2"}, nodeInfo.WhitelistedRingIds) +} + +func TestMsgServer_UpdateNodeInfo_UpdatePeerId(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctx.WithValue(appparams.ExtractedDIDContextKey, testDID) + + nodeAddr, nodePubKeyHex := testAccountWithPubKey(t, ctx, authKeeper) + controllerAddr, controllerPubKeyHex := testAccountWithPubKey(t, ctx, authKeeper) + + _, err := k.CreateNodeInfo(ctx, &types.MsgCreateNodeInfo{ + Creator: nodeAddr, + PeerId: "peer-original", + ControllerKey: controllerPubKeyHex, + }) + require.NoError(t, err) + + _, err = k.UpdateNodeInfo(ctx, &types.MsgUpdateNodeInfo{ + Creator: controllerAddr, + NodeKey: nodePubKeyHex, + XPeerId: &types.MsgUpdateNodeInfo_PeerId{PeerId: "peer-updated"}, + }) + require.NoError(t, err) + + nodeInfo := k.GetNodeInfo(ctx, nodePubKeyHex) + require.NotNil(t, nodeInfo) + require.Equal(t, "peer-updated", nodeInfo.PeerId) +} + +func TestMsgServer_UpdateNodeInfo_AbsentPeerIdIsNotCleared(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctx.WithValue(appparams.ExtractedDIDContextKey, testDID) + + nodeAddr, nodePubKeyHex := testAccountWithPubKey(t, ctx, authKeeper) + controllerAddr, controllerPubKeyHex := testAccountWithPubKey(t, ctx, authKeeper) + + _, err := k.CreateNodeInfo(ctx, &types.MsgCreateNodeInfo{ + Creator: nodeAddr, + PeerId: "peer-original", + ControllerKey: controllerPubKeyHex, + }) + require.NoError(t, err) + + _, err = k.UpdateNodeInfo(ctx, &types.MsgUpdateNodeInfo{ + Creator: controllerAddr, + NodeKey: nodePubKeyHex, + WhitelistedRingIds: []string{"ring-1"}, + }) + require.NoError(t, err) + + nodeInfo := k.GetNodeInfo(ctx, nodePubKeyHex) + require.Equal(t, "peer-original", nodeInfo.PeerId) +} + +func TestMsgServer_UpdateNodeInfo_NotFound(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctx.WithValue(appparams.ExtractedDIDContextKey, testDID) + + controllerAddr, _ := testAccountWithPubKey(t, ctx, authKeeper) + + _, err := k.UpdateNodeInfo(ctx, &types.MsgUpdateNodeInfo{ + Creator: controllerAddr, + NodeKey: "nonexistent-key", + }) + require.ErrorIs(t, err, types.ErrNodeInfoNotFound) +} + +func TestMsgServer_UpdateNodeInfo_Unauthorized(t *testing.T) { + k, authKeeper, ctx := keepertestutil.OrbisKeeperFull(t) + ctx = ctx.WithValue(appparams.ExtractedDIDContextKey, testDID) + + nodeAddr, nodePubKeyHex := testAccountWithPubKey(t, ctx, authKeeper) + _, controllerPubKeyHex := testAccountWithPubKey(t, ctx, authKeeper) + wrongAddr, _ := testAccountWithPubKey(t, ctx, authKeeper) + + _, err := k.CreateNodeInfo(ctx, &types.MsgCreateNodeInfo{ + Creator: nodeAddr, + PeerId: "peer-1", + ControllerKey: controllerPubKeyHex, + }) + require.NoError(t, err) + + _, err = k.UpdateNodeInfo(ctx, &types.MsgUpdateNodeInfo{ + Creator: wrongAddr, + NodeKey: nodePubKeyHex, + }) + require.ErrorIs(t, err, types.ErrUnauthorizedNodeInfoUpdate) +} + +// setupPeerWithNodeInfo registers an account and creates a NodeInfo entry for it. +// Returns the account bech32 address and its hex-encoded public key (the node_key used in rings). +func setupPeerWithNodeInfo(t *testing.T, k keeper.Keeper, ak authkeeper.AccountKeeper, ctx sdk.Context, networkID string) (addr string, nodeKey string) { + t.Helper() + addr, nodeKey = testAccountWithPubKey(t, ctx, ak) + _, err := k.CreateNodeInfo(ctx, &types.MsgCreateNodeInfo{ + Creator: addr, + PeerId: networkID, + ControllerKey: nodeKey, + }) + require.NoError(t, err) + return addr, nodeKey +} + +func updatePeerNodeWhitelists( + t *testing.T, + k keeper.Keeper, + ctx sdk.Context, + creator string, + nodeKey string, + policyIDs []string, + ringIDs []string, +) { + t.Helper() + _, err := k.UpdateNodeInfo(ctx, &types.MsgUpdateNodeInfo{ + Creator: creator, + NodeKey: nodeKey, + WhitelistedPolicyIds: policyIDs, + WhitelistedRingIds: ringIDs, + }) + require.NoError(t, err) +} + +func createOrbisRingPolicy(t *testing.T, k keeper.Keeper, ctx sdk.Context, creator string) string { + t.Helper() + policyID := createACPPolicy(t, k, ctx, creator, testOrbisRingPolicy) + registerRingPolicyControlObject(t, k, ctx, creator, policyID) + return policyID +} + +func createACPPolicy(t *testing.T, k keeper.Keeper, ctx sdk.Context, creator string, policy string) string { + t.Helper() + resp, err := k.GetAcpKeeper().CreatePolicy(ctx, &acptypes.MsgCreatePolicy{ + Creator: creator, + Policy: policy, + MarshalType: coretypes.PolicyMarshalingType_YAML, + }) + require.NoError(t, err) + return resp.Record.Policy.Id +} + +func registerRingPolicyControlObject(t *testing.T, k keeper.Keeper, ctx sdk.Context, creator string, policyID string) { + t.Helper() + _, err := k.GetAcpKeeper().DirectPolicyCmd(ctx, &acptypes.MsgDirectPolicyCmd{ + Creator: creator, + PolicyId: policyID, + Cmd: acptypes.NewRegisterObjectCmd(coretypes.NewObject(types.ACPResourceRingPolicy, policyID)), + }) + require.NoError(t, err) +} + +func grantRingCreator(t *testing.T, k keeper.Keeper, ctx sdk.Context, creator string, policyID string, actorDID string) { + t.Helper() + _, err := k.GetAcpKeeper().DirectPolicyCmd(ctx, &acptypes.MsgDirectPolicyCmd{ + Creator: creator, + PolicyId: policyID, + Cmd: acptypes.NewSetRelationshipCmd(coretypes.NewActorRelationship( + types.ACPResourceRingPolicy, + policyID, + types.ACPRelationRingCreator, + actorDID, + )), + }) + require.NoError(t, err) +} + +func ctxWithDID(ctx sdk.Context, did string) sdk.Context { + return ctx.WithValue(appparams.ExtractedDIDContextKey, did) +} + +// testAccountWithPubKey creates a secp256k1 keypair, registers the account in the auth keeper, +// and returns the bech32 address and hex-encoded public key bytes. +func testAccountWithPubKey(t *testing.T, ctx sdk.Context, ak authkeeper.AccountKeeper) (addr string, pubKeyHex string) { + t.Helper() + privKey := secp256k1.GenPrivKey() + pubKey := privKey.PubKey() + accAddr := sdk.AccAddress(pubKey.Address()) + account := ak.NewAccountWithAddress(ctx, accAddr) + if err := account.SetPubKey(pubKey); err != nil { + t.Fatal(err) + } + ak.SetAccount(ctx, account) + return accAddr.String(), hex.EncodeToString(pubKey.Bytes()) +} + +// testPeerID returns a unique libp2p-style peer ID string for use in tests. +func testPeerID(n int) string { + return fmt.Sprintf("12D3KooWTestPeer%d", n) +} diff --git a/x/orbis/keeper/optional.go b/x/orbis/keeper/optional.go new file mode 100644 index 00000000..e3502576 --- /dev/null +++ b/x/orbis/keeper/optional.go @@ -0,0 +1,83 @@ +package keeper + +import "github.com/sourcenetwork/sourcehub/x/orbis/types" + +func optionalCreateRingPSSInterval(msg *types.MsgCreateRing) *uint64 { + if msg.XPssInterval == nil { + return nil + } + value := msg.GetPssInterval() + return &value +} + +func optionalCreateRingNonce(msg *types.MsgCreateRing) *string { + if msg.XNonce == nil { + return nil + } + value := msg.GetNonce() + return &value +} + +func optionalUpdateRingNewThreshold(msg *types.MsgUpdateRingByAcp) *uint32 { + if msg.XNewThreshold == nil { + return nil + } + value := msg.GetNewThreshold() + return &value +} + +func optionalUpdateRingPSSInterval(msg *types.MsgUpdateRingByAcp) *uint64 { + if msg.XPssInterval == nil { + return nil + } + value := msg.GetPssInterval() + return &value +} + +func optionalStoreDocumentTier(msg *types.MsgStoreDocument) *string { + if msg.XTier == nil { + return nil + } + value := msg.GetTier() + return &value +} + +func optionalStoreDocumentTimestamp(msg *types.MsgStoreDocument) *uint64 { + if msg.XTimestamp == nil { + return nil + } + value := msg.GetTimestamp() + return &value +} + +func setRingNewThreshold(ring *types.Ring, value *uint32) { + if value == nil { + ring.XNewThreshold = nil + return + } + ring.XNewThreshold = &types.Ring_NewThreshold{NewThreshold: *value} +} + +func setRingPSSInterval(ring *types.Ring, value *uint64) { + if value == nil { + ring.XPssInterval = nil + return + } + ring.XPssInterval = &types.Ring_PssInterval{PssInterval: *value} +} + +func setDocumentTier(document *types.Document, value *string) { + if value == nil { + document.XTier = nil + return + } + document.XTier = &types.Document_Tier{Tier: *value} +} + +func setDocumentTimestamp(document *types.Document, value *uint64) { + if value == nil { + document.XTimestamp = nil + return + } + document.XTimestamp = &types.Document_Timestamp{Timestamp: *value} +} diff --git a/x/orbis/keeper/params.go b/x/orbis/keeper/params.go new file mode 100644 index 00000000..39fb1833 --- /dev/null +++ b/x/orbis/keeper/params.go @@ -0,0 +1,33 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/runtime" + + "github.com/sourcenetwork/sourcehub/x/orbis/types" +) + +// GetParams gets all parameters as types.Params. +func (k *Keeper) GetParams(ctx context.Context) (params types.Params) { + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + bz := store.Get(types.ParamsKey) + if bz == nil { + return params + } + + k.cdc.MustUnmarshal(bz, ¶ms) + return params +} + +// SetParams sets the params. +func (k *Keeper) SetParams(ctx context.Context, params types.Params) error { + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + bz, err := k.cdc.Marshal(¶ms) + if err != nil { + return err + } + store.Set(types.ParamsKey, bz) + + return nil +} diff --git a/x/orbis/keeper/reshare_sign_bytes.go b/x/orbis/keeper/reshare_sign_bytes.go new file mode 100644 index 00000000..f3b83980 --- /dev/null +++ b/x/orbis/keeper/reshare_sign_bytes.go @@ -0,0 +1,77 @@ +package keeper + +import ( + "crypto/sha256" + "sort" + + "github.com/sourcenetwork/sourcehub/x/orbis/types" +) + +const RingReshareFinalizeSignDocDomain = "orbis-ring-reshare-finalize" + +func ringReshareFinalizeSignBytes( + chainID string, + currentRing *types.Ring, + finalizedRing *types.Ring, +) ([]byte, error) { + currentRingHash, err := ringReshareSignStateHash(currentRing) + if err != nil { + return nil, err + } + finalizedRingHash, err := ringReshareSignStateHash(finalizedRing) + if err != nil { + return nil, err + } + + signDoc := types.RingReshareFinalizeSignDoc{ + Domain: RingReshareFinalizeSignDocDomain, + ChainId: chainID, + RingId: currentRing.Id, + RingPk: currentRing.RingPk, + CurrentRingSha256: currentRingHash, + FinalizedRingSha256: finalizedRingHash, + BlockNumberNonce: currentRing.BlockNumberNonce, + } + + return signDoc.Marshal() +} + +func ringReshareSignStateHash(ring *types.Ring) ([]byte, error) { + signState := ringReshareSignState(ring) + signStateBytes, err := signState.Marshal() + if err != nil { + return nil, err + } + + hash := sha256.Sum256(signStateBytes) + return hash[:], nil +} + +func ringReshareSignState(ring *types.Ring) types.RingReshareSignState { + signState := types.RingReshareSignState{ + RingPk: ring.RingPk, + PeerNodeKeys: sortedStringCopy(ring.PeerNodeKeys), + Threshold: ring.Threshold, + NewPeerNodeKeys: sortedStringCopy(ring.NewPeerNodeKeys), + BlockNumberNonce: ring.BlockNumberNonce, + PolicyId: ring.PolicyId, + } + if ring.XNewThreshold != nil { + signState.XNewThreshold = &types.RingReshareSignState_NewThreshold{ + NewThreshold: ring.GetNewThreshold(), + } + } + if ring.XPssInterval != nil { + signState.XPssInterval = &types.RingReshareSignState_PssInterval{ + PssInterval: ring.GetPssInterval(), + } + } + + return signState +} + +func sortedStringCopy(values []string) []string { + copied := append([]string(nil), values...) + sort.Strings(copied) + return copied +} diff --git a/x/orbis/keeper/reshare_sign_bytes_test.go b/x/orbis/keeper/reshare_sign_bytes_test.go new file mode 100644 index 00000000..9d739d6d --- /dev/null +++ b/x/orbis/keeper/reshare_sign_bytes_test.go @@ -0,0 +1,89 @@ +package keeper + +import ( + "strings" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/sourcenetwork/sourcehub/x/orbis/types" +) + +func TestRingReshareFinalizeSignBytesUseCanonicalOrbisSignState(t *testing.T) { + nodeA := "02" + strings.Repeat("11", 32) + nodeB := "02" + strings.Repeat("22", 32) + nodeC := "02" + strings.Repeat("33", 32) + nodeD := "02" + strings.Repeat("44", 32) + + current := &types.Ring{ + Id: "ring-id", + CreatorDid: "did:example:one", + RingPk: "ring-pk", + PeerNodeKeys: []string{nodeB, nodeA}, + Threshold: 2, + NewPeerNodeKeys: []string{nodeD, nodeC}, + XNewThreshold: &types.Ring_NewThreshold{ + NewThreshold: 1, + }, + XPssInterval: &types.Ring_PssInterval{ + PssInterval: 30, + }, + BlockNumberNonce: 9, + PolicyId: "policy-id", + Confirmations: []*types.RingConfirmation{ + {NodeKey: nodeA, RingPk: "ring-pk"}, + }, + } + finalized, err := ringForReshareFinalization(current) + require.NoError(t, err) + + signBytes, err := ringReshareFinalizeSignBytes("sourcehub-test", current, finalized) + require.NoError(t, err) + + sameSignState := &types.Ring{ + Id: "ring-id", + CreatorDid: "did:example:two", + RingPk: "ring-pk", + PeerNodeKeys: []string{nodeA, nodeB}, + Threshold: 2, + NewPeerNodeKeys: []string{nodeC, nodeD}, + XNewThreshold: &types.Ring_NewThreshold{ + NewThreshold: 1, + }, + XPssInterval: &types.Ring_PssInterval{ + PssInterval: 30, + }, + BlockNumberNonce: 9, + PolicyId: "policy-id", + Confirmations: []*types.RingConfirmation{ + {NodeKey: nodeB, RingPk: "different-storage-only-value"}, + }, + } + sameSignStateFinalized, err := ringForReshareFinalization(sameSignState) + require.NoError(t, err) + + sameSignStateBytes, err := ringReshareFinalizeSignBytes( + "sourcehub-test", + sameSignState, + sameSignStateFinalized, + ) + require.NoError(t, err) + + require.Equal(t, signBytes, sameSignStateBytes) + + distinctSignState := *current + distinctSignState.XNewThreshold = &types.Ring_NewThreshold{ + NewThreshold: 2, + } + distinctSignStateFinalized, err := ringForReshareFinalization(&distinctSignState) + require.NoError(t, err) + + distinctSignStateBytes, err := ringReshareFinalizeSignBytes( + "sourcehub-test", + &distinctSignState, + distinctSignStateFinalized, + ) + require.NoError(t, err) + + require.NotEqual(t, signBytes, distinctSignStateBytes) +} diff --git a/x/orbis/keeper/store.go b/x/orbis/keeper/store.go new file mode 100644 index 00000000..7c527a1e --- /dev/null +++ b/x/orbis/keeper/store.go @@ -0,0 +1,181 @@ +package keeper + +import ( + "context" + + "cosmossdk.io/store/prefix" + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/runtime" + + "github.com/sourcenetwork/sourcehub/x/orbis/types" +) + +func (k *Keeper) SetRing(ctx context.Context, ring types.Ring) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.RingKeyPrefix)) + bz := k.cdc.MustMarshal(&ring) + store.Set([]byte(ring.Id), bz) +} + +func (k *Keeper) GetRing(ctx context.Context, ringID string) *types.Ring { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.RingKeyPrefix)) + bz := store.Get([]byte(ringID)) + if bz == nil { + return nil + } + + var ring types.Ring + k.cdc.MustUnmarshal(bz, &ring) + return &ring +} + +func (k *Keeper) DeleteRing(ctx context.Context, ringID string) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.RingKeyPrefix)) + store.Delete([]byte(ringID)) +} + +func (k *Keeper) GetAllRings(ctx context.Context) []types.Ring { + var rings []types.Ring + k.mustIterateRings(ctx, func(ring types.Ring) { + rings = append(rings, ring) + }) + return rings +} + +func (k *Keeper) SetDocument(ctx context.Context, document types.Document) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.DocumentKeyPrefix)) + bz := k.cdc.MustMarshal(&document) + store.Set([]byte(document.Id), bz) +} + +func (k *Keeper) GetDocument(ctx context.Context, documentID string) *types.Document { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.DocumentKeyPrefix)) + bz := store.Get([]byte(documentID)) + if bz == nil { + return nil + } + + var document types.Document + k.cdc.MustUnmarshal(bz, &document) + return &document +} + +func (k *Keeper) GetAllDocuments(ctx context.Context) []types.Document { + var documents []types.Document + k.mustIterateDocuments(ctx, func(document types.Document) { + documents = append(documents, document) + }) + return documents +} + +func (k *Keeper) SetKeyDerivation(ctx context.Context, keyDerivation types.KeyDerivation) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.KeyDerivationKeyPrefix)) + bz := k.cdc.MustMarshal(&keyDerivation) + store.Set([]byte(keyDerivation.Id), bz) +} + +func (k *Keeper) GetKeyDerivation(ctx context.Context, keyDerivationID string) *types.KeyDerivation { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.KeyDerivationKeyPrefix)) + bz := store.Get([]byte(keyDerivationID)) + if bz == nil { + return nil + } + + var keyDerivation types.KeyDerivation + k.cdc.MustUnmarshal(bz, &keyDerivation) + return &keyDerivation +} + +func (k *Keeper) GetAllKeyDerivations(ctx context.Context) []types.KeyDerivation { + var keyDerivations []types.KeyDerivation + k.mustIterateKeyDerivations(ctx, func(keyDerivation types.KeyDerivation) { + keyDerivations = append(keyDerivations, keyDerivation) + }) + return keyDerivations +} + +func (k *Keeper) mustIterateRings(ctx context.Context, cb func(ring types.Ring)) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.RingKeyPrefix)) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var ring types.Ring + k.cdc.MustUnmarshal(iterator.Value(), &ring) + cb(ring) + } +} + +func (k *Keeper) mustIterateDocuments(ctx context.Context, cb func(document types.Document)) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.DocumentKeyPrefix)) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var document types.Document + k.cdc.MustUnmarshal(iterator.Value(), &document) + cb(document) + } +} + +func (k *Keeper) mustIterateKeyDerivations(ctx context.Context, cb func(keyDerivation types.KeyDerivation)) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.KeyDerivationKeyPrefix)) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var keyDerivation types.KeyDerivation + k.cdc.MustUnmarshal(iterator.Value(), &keyDerivation) + cb(keyDerivation) + } +} + +func (k *Keeper) SetNodeInfo(ctx context.Context, nodeKey string, nodeInfo types.NodeInfo) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.NodeInfoKeyPrefix)) + bz := k.cdc.MustMarshal(&nodeInfo) + store.Set([]byte(nodeKey), bz) +} + +func (k *Keeper) GetNodeInfo(ctx context.Context, nodeKey string) *types.NodeInfo { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.NodeInfoKeyPrefix)) + bz := store.Get([]byte(nodeKey)) + if bz == nil { + return nil + } + + var nodeInfo types.NodeInfo + k.cdc.MustUnmarshal(bz, &nodeInfo) + return &nodeInfo +} + +func (k *Keeper) GetAllNodeInfos(ctx context.Context) []types.NodeInfoEntry { + var entries []types.NodeInfoEntry + k.mustIterateNodeInfos(ctx, func(nodeKey string, nodeInfo types.NodeInfo) { + entries = append(entries, types.NodeInfoEntry{NodeKey: nodeKey, NodeInfo: &nodeInfo}) + }) + return entries +} + +func (k *Keeper) mustIterateNodeInfos(ctx context.Context, cb func(nodeKey string, nodeInfo types.NodeInfo)) { + storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.NodeInfoKeyPrefix)) + iterator := storetypes.KVStorePrefixIterator(store, []byte{}) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var nodeInfo types.NodeInfo + k.cdc.MustUnmarshal(iterator.Value(), &nodeInfo) + cb(string(iterator.Key()), nodeInfo) + } +} diff --git a/x/bulletin/keeper/threshold_signature.go b/x/orbis/keeper/threshold_signature.go similarity index 91% rename from x/bulletin/keeper/threshold_signature.go rename to x/orbis/keeper/threshold_signature.go index b318727a..07d170cf 100644 --- a/x/bulletin/keeper/threshold_signature.go +++ b/x/orbis/keeper/threshold_signature.go @@ -10,7 +10,7 @@ import ( "github.com/mizufinance/decaf377-go/orbisfrost" blst "github.com/supranational/blst/bindings/go" - "github.com/sourcenetwork/sourcehub/x/bulletin/types" + "github.com/sourcenetwork/sourcehub/x/orbis/types" ) const ( @@ -24,13 +24,8 @@ const ( decaf377SignatureSize = decaf377.ElementSize + decaf377.ScalarSize ) -func verifyThresholdSignatureForRingPayloadUpdate( - currentRingPayload *ringPayloadJSON, - message []byte, - scheme string, - signature []byte, -) error { - return verifyThresholdSignature(scheme, *currentRingPayload.RingPK, message, signature) +func verifyThresholdSignatureForRingUpdate(ring *types.Ring, message []byte, scheme string, signature []byte) error { + return verifyThresholdSignature(scheme, ring.RingPk, message, signature) } func verifyThresholdSignature(scheme string, ringPK string, message []byte, signature []byte) error { diff --git a/x/orbis/keeper/validation.go b/x/orbis/keeper/validation.go new file mode 100644 index 00000000..4d3742ed --- /dev/null +++ b/x/orbis/keeper/validation.go @@ -0,0 +1,185 @@ +package keeper + +import ( + "encoding/hex" + "strings" + + errorsmod "cosmossdk.io/errors" + + "github.com/sourcenetwork/sourcehub/x/orbis/types" +) + +func requireRingFinalized(ring *types.Ring) error { + if ring.RingPk == "" { + return types.ErrRingNotFinalized + } + return nil +} + +func validateRing(ring *types.Ring) error { + switch { + case ring.Id == "": + return types.ErrInvalidRingId + case len(ring.PeerNodeKeys) == 0: + return errorsmod.Wrap(types.ErrInvalidRing, "missing peer_node_keys") + case ring.Threshold == 0 || int(ring.Threshold) > len(ring.PeerNodeKeys): + return errorsmod.Wrapf(types.ErrInvalidRing, "threshold %d is invalid for committee size %d", ring.Threshold, len(ring.PeerNodeKeys)) + case ring.PolicyId == "": + return errorsmod.Wrap(types.ErrInvalidRing, "missing policy_id") + } + + if err := validateUniquePeerNodeKeys(ring.PeerNodeKeys); err != nil { + return err + } + if len(ring.NewPeerNodeKeys) > 0 { + if err := validateUniquePeerNodeKeys(ring.NewPeerNodeKeys); err != nil { + return err + } + } + if ring.XNewThreshold != nil && ring.GetNewThreshold() == 0 { + return errorsmod.Wrap(types.ErrInvalidRing, "new_threshold must be at least 1") + } + if len(ring.NewPeerNodeKeys) > 0 && ring.XNewThreshold != nil && uint32(len(ring.NewPeerNodeKeys)) < ring.GetNewThreshold() { + return errorsmod.Wrapf( + types.ErrInvalidRing, + "new_peer_node_keys count (%d) is less than new_threshold (%d)", + len(ring.NewPeerNodeKeys), + ring.GetNewThreshold(), + ) + } + + return nil +} + +func validateRingUpdate(newPeerNodeKeys []string, newThreshold *uint32, existing *types.Ring) error { + reshareInProgress := len(existing.NewPeerNodeKeys) > 0 || existing.XNewThreshold != nil + touchingReshareFields := len(newPeerNodeKeys) > 0 || newThreshold != nil + if reshareInProgress && touchingReshareFields { + return types.ErrReshareInProgress + } + + if len(newPeerNodeKeys) > 0 { + if err := validateUniquePeerNodeKeys(newPeerNodeKeys); err != nil { + return err + } + } + if newThreshold != nil && *newThreshold < 1 { + return errorsmod.Wrap(types.ErrInvalidRing, "new_threshold must be at least 1") + } + if len(newPeerNodeKeys) == 0 && newThreshold != nil && *newThreshold > uint32(len(existing.PeerNodeKeys)) { + return errorsmod.Wrapf( + types.ErrInvalidRing, + "new_threshold (%d) cannot exceed existing committee size (%d)", + *newThreshold, + len(existing.PeerNodeKeys), + ) + } + if len(newPeerNodeKeys) > 0 && newThreshold != nil && uint32(len(newPeerNodeKeys)) < *newThreshold { + return errorsmod.Wrapf( + types.ErrInvalidRing, + "new_peer_node_keys count (%d) is less than new_threshold (%d)", + len(newPeerNodeKeys), + *newThreshold, + ) + } + + return nil +} + +// validateUniquePeerNodeKeys checks that each node key is a unique, validly-encoded +// 33-byte compressed secp256k1 public key. +func validateUniquePeerNodeKeys(nodeKeys []string) error { + seen := make(map[string]struct{}, len(nodeKeys)) + for _, key := range nodeKeys { + if err := validatePeerNodeKeyFormat(key); err != nil { + return err + } + if _, dup := seen[key]; dup { + return errorsmod.Wrapf(types.ErrInvalidRing, "duplicate peer_node_key: %q", key) + } + seen[key] = struct{}{} + } + return nil +} + +func validatePeerNodeKeyFormat(key string) error { + if key == "" { + return errorsmod.Wrap(types.ErrInvalidRing, "empty peer_node_key") + } + keyHex := strings.TrimPrefix(key, "0x") + decoded, err := hex.DecodeString(keyHex) + if err != nil || len(decoded) != compressedPubKeyLen { + return errorsmod.Wrapf(types.ErrInvalidRing, "invalid peer_node_key encoding: %q", key) + } + return nil +} + +func ringForReshareFinalization(currentRing *types.Ring) (*types.Ring, error) { + finalized := *currentRing + if len(finalized.NewPeerNodeKeys) == 0 && finalized.XNewThreshold == nil { + return nil, errorsmod.Wrap(types.ErrInvalidRing, "missing new_peer_node_keys or new_threshold for reshare finalization") + } + + if len(finalized.NewPeerNodeKeys) > 0 { + finalized.PeerNodeKeys = append([]string(nil), finalized.NewPeerNodeKeys...) + } + if finalized.XNewThreshold != nil { + finalized.Threshold = finalized.GetNewThreshold() + } + finalized.NewPeerNodeKeys = nil + finalized.XNewThreshold = nil + + if err := validateRing(&finalized); err != nil { + return nil, err + } + + return &finalized, nil +} + +func validateDocument(document *types.Document) error { + switch { + case document.Id == "": + return types.ErrInvalidDocumentId + case document.RingId == "": + return types.ErrInvalidRingId + case document.Document == "": + return errorsmod.Wrap(types.ErrInvalidDocument, "missing document") + case document.Proof == "": + return errorsmod.Wrap(types.ErrInvalidDocument, "missing proof") + case document.PolicyId == "" || document.Resource == "" || document.Permission == "": + return errorsmod.Wrap(types.ErrInvalidDocument, "missing policy binding") + } + return nil +} + +func validateKeyDerivation(keyDerivation *types.KeyDerivation) error { + switch { + case keyDerivation.Id == "": + return types.ErrInvalidKeyDerivationId + case keyDerivation.RingId == "": + return types.ErrInvalidRingId + case keyDerivation.Derivation == "": + return errorsmod.Wrap(types.ErrInvalidKeyDerivation, "missing derivation") + case keyDerivation.PolicyId == "" || keyDerivation.Resource == "" || keyDerivation.Permission == "": + return errorsmod.Wrap(types.ErrInvalidKeyDerivation, "missing policy binding") + } + return nil +} + +// secp256k1 compressed public key length in bytes +const compressedPubKeyLen = 33 + +func validateNodeInfo(nodeInfo *types.NodeInfo) error { + switch { + case nodeInfo.PeerId == "": + return errorsmod.Wrap(types.ErrInvalidNodeInfo, "missing peer_id") + case nodeInfo.ControllerKey == "": + return errorsmod.Wrap(types.ErrInvalidNodeInfo, "missing controller_key") + } + keyHex := strings.TrimPrefix(nodeInfo.ControllerKey, "0x") + decoded, err := hex.DecodeString(keyHex) + if err != nil || len(decoded) != compressedPubKeyLen { + return errorsmod.Wrap(types.ErrInvalidNodeInfo, "invalid controller_key encoding") + } + return nil +} diff --git a/x/orbis/module/autocli.go b/x/orbis/module/autocli.go new file mode 100644 index 00000000..87fe8f04 --- /dev/null +++ b/x/orbis/module/autocli.go @@ -0,0 +1,104 @@ +package orbis + +import ( + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + + modulev1 "github.com/sourcenetwork/sourcehub/api/sourcehub/orbis" +) + +// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: modulev1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + {RpcMethod: "Params", Use: "params", Short: "Shows the parameters of the module"}, + { + RpcMethod: "Ring", + Use: "ring [id]", + Short: "Query ring by id", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "id"}}, + }, + {RpcMethod: "Rings", Use: "rings", Short: "Query rings"}, + { + RpcMethod: "Document", + Use: "document [id]", + Short: "Query document by id", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "id"}}, + }, + { + RpcMethod: "Documents", + Use: "documents", + Short: "Query documents", + }, + { + RpcMethod: "KeyDerivation", + Use: "key-derivation [id]", + Short: "Query key derivation by id", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "id"}}, + }, + { + RpcMethod: "KeyDerivations", + Use: "key-derivations", + Short: "Query key derivations", + }, + { + RpcMethod: "NodeInfo", + Use: "node-info [node_key]", + Short: "Query node info by node key", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "node_key"}}, + }, + }, + }, + Tx: &autocliv1.ServiceCommandDescriptor{ + Service: modulev1.Msg_ServiceDesc.ServiceName, + EnhanceCustomCommand: true, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + {RpcMethod: "UpdateParams", Skip: true}, + { + RpcMethod: "CreateRing", + Use: "create-ring [threshold] [policy_id]", + Short: "Create an Orbis ring", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "threshold"}, {ProtoField: "policy_id"}}, + }, + { + RpcMethod: "UpdateRingByAcp", + Use: "update-ring-by-acp [ring_id]", + Short: "Update pending ring reshare fields via external ACP policy", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "ring_id"}}, + }, + { + RpcMethod: "FinalizeRingReshareByThresholdSignature", + Use: "finalize-ring-reshare [ring_id] [signature_scheme] [signature]", + Short: "Finalize a ring reshare using a threshold signature", + Long: "Finalize a ring reshare using a threshold signature. The signature argument is a bytes field and must be base64-encoded.", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "ring_id"}, {ProtoField: "signature_scheme"}, {ProtoField: "signature"}}, + }, + { + RpcMethod: "StoreDocument", + Use: "store-document [ring_id] [document] [proof] [policy_id] [resource] [permission]", + Short: "Store an encrypted Orbis document", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "ring_id"}, {ProtoField: "document"}, {ProtoField: "proof"}, {ProtoField: "policy_id"}, {ProtoField: "resource"}, {ProtoField: "permission"}}, + }, + { + RpcMethod: "StoreKeyDerivation", + Use: "store-key-derivation [ring_id] [derivation] [policy_id] [resource] [permission]", + Short: "Store an Orbis key derivation", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "ring_id"}, {ProtoField: "derivation"}, {ProtoField: "policy_id"}, {ProtoField: "resource"}, {ProtoField: "permission"}}, + }, + { + RpcMethod: "CreateNodeInfo", + Use: "create-node-info [peer_id] [controller_key]", + Short: "Create a node info record (store key derived from signing key)", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "peer_id"}, {ProtoField: "controller_key"}}, + }, + { + RpcMethod: "UpdateNodeInfo", + Use: "update-node-info [node_key]", + Short: "Update a node info record (signer must match stored controller key)", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "node_key"}}, + }, + }, + }, + } +} diff --git a/x/orbis/module/genesis.go b/x/orbis/module/genesis.go new file mode 100644 index 00000000..bfb45bc7 --- /dev/null +++ b/x/orbis/module/genesis.go @@ -0,0 +1,41 @@ +package orbis + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/sourcenetwork/sourcehub/x/orbis/keeper" + "github.com/sourcenetwork/sourcehub/x/orbis/types" +) + +// InitGenesis initializes the module's state from a provided genesis state. +func InitGenesis(ctx sdk.Context, k *keeper.Keeper, genState types.GenesisState) { + if err := k.SetParams(ctx, genState.Params); err != nil { + panic(err) + } + + for _, ring := range genState.Rings { + k.SetRing(ctx, ring) + } + for _, document := range genState.Documents { + k.SetDocument(ctx, document) + } + for _, keyDerivation := range genState.KeyDerivations { + k.SetKeyDerivation(ctx, keyDerivation) + } + for _, entry := range genState.NodeInfos { + if entry.NodeInfo != nil { + k.SetNodeInfo(ctx, entry.NodeKey, *entry.NodeInfo) + } + } +} + +// ExportGenesis returns the module's exported genesis. +func ExportGenesis(ctx sdk.Context, k *keeper.Keeper) *types.GenesisState { + genesis := types.DefaultGenesis() + genesis.Params = k.GetParams(ctx) + genesis.Rings = k.GetAllRings(ctx) + genesis.Documents = k.GetAllDocuments(ctx) + genesis.KeyDerivations = k.GetAllKeyDerivations(ctx) + genesis.NodeInfos = k.GetAllNodeInfos(ctx) + return genesis +} diff --git a/x/orbis/module/module.go b/x/orbis/module/module.go new file mode 100644 index 00000000..649b3dee --- /dev/null +++ b/x/orbis/module/module.go @@ -0,0 +1,156 @@ +package orbis + +import ( + "context" + "encoding/json" + "fmt" + + "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/store" + "cosmossdk.io/depinject" + "cosmossdk.io/log" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + + modulev1 "github.com/sourcenetwork/sourcehub/api/sourcehub/orbis/module" + "github.com/sourcenetwork/sourcehub/app/metrics" + acpkeeper "github.com/sourcenetwork/sourcehub/x/acp/keeper" + "github.com/sourcenetwork/sourcehub/x/orbis/keeper" + "github.com/sourcenetwork/sourcehub/x/orbis/types" +) + +var ( + _ module.AppModuleBasic = (*AppModule)(nil) + _ module.AppModuleSimulation = (*AppModule)(nil) + _ module.HasGenesis = (*AppModule)(nil) + _ module.HasInvariants = (*AppModule)(nil) + _ module.HasConsensusVersion = (*AppModule)(nil) + + _ appmodule.AppModule = (*AppModule)(nil) +) + +type AppModuleBasic struct { + cdc codec.BinaryCodec +} + +func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic { + return AppModuleBasic{cdc: cdc} +} + +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} + +func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { + types.RegisterInterfaces(reg) +} + +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesis()) +} + +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { + var genState types.GenesisState + if err := cdc.UnmarshalJSON(bz, &genState); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + return genState.Validate() +} + +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { + panic(err) + } +} + +type AppModule struct { + AppModuleBasic + + keeper *keeper.Keeper +} + +func NewAppModule(cdc codec.Codec, keeper *keeper.Keeper) AppModule { + return AppModule{ + AppModuleBasic: NewAppModuleBasic(cdc), + keeper: keeper, + } +} + +func (am AppModule) RegisterServices(cfg module.Configurator) { + descriptor := metrics.WrapMsgServerServiceDescriptor(types.ModuleName, types.Msg_serviceDesc) + cfg.MsgServer().RegisterService(&descriptor, am.keeper) + + descriptor = metrics.WrapQueryServiceDescriptor(types.ModuleName, types.Query_serviceDesc) + cfg.QueryServer().RegisterService(&descriptor, am.keeper) +} + +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} + +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) { + var genState types.GenesisState + cdc.MustUnmarshalJSON(gs, &genState) + InitGenesis(ctx, am.keeper, genState) +} + +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + genState := ExportGenesis(ctx, am.keeper) + return cdc.MustMarshalJSON(genState) +} + +func (AppModule) ConsensusVersion() uint64 { return 1 } + +func (am AppModule) IsOnePerModuleType() {} + +func (am AppModule) IsAppModule() {} + +func init() { + appmodule.Register( + &modulev1.Module{}, + appmodule.Provide(ProvideModule), + ) +} + +type ModuleInputs struct { + depinject.In + + StoreService store.KVStoreService + Cdc codec.Codec + Config *modulev1.Module + Logger log.Logger + + AccountKeeper types.AccountKeeper + AcpKeeper *acpkeeper.Keeper +} + +type ModuleOutputs struct { + depinject.Out + + OrbisKeeper *keeper.Keeper + Module appmodule.AppModule +} + +func ProvideModule(in ModuleInputs) ModuleOutputs { + authority := authtypes.NewModuleAddress(govtypes.ModuleName) + if in.Config.Authority != "" { + authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) + } + k := keeper.NewKeeper( + in.Cdc, + in.StoreService, + in.Logger, + authority.String(), + in.AccountKeeper, + in.AcpKeeper, + ) + m := NewAppModule(in.Cdc, &k) + + return ModuleOutputs{OrbisKeeper: &k, Module: m} +} diff --git a/x/orbis/module/simulation.go b/x/orbis/module/simulation.go new file mode 100644 index 00000000..21766e6a --- /dev/null +++ b/x/orbis/module/simulation.go @@ -0,0 +1,29 @@ +package orbis + +import ( + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" +) + +var _ module.AppModuleSimulation = AppModule{} + +// GenerateGenesisState creates a randomized GenState of the module. +func (AppModule) GenerateGenesisState(*module.SimulationState) {} + +// RegisterStoreDecoder registers a decoder for orbis module's types. +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} + +// ProposalContents doesn't return any content functions for governance proposals. +func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { + return nil +} + +// WeightedOperations returns all the operations from the module with their respective weights. +func (am AppModule) WeightedOperations(module.SimulationState) []simtypes.WeightedOperation { + return nil +} + +// ProposalMsgs returns msgs used for governance proposals for simulations. +func (am AppModule) ProposalMsgs(module.SimulationState) []simtypes.WeightedProposalMsg { + return nil +} diff --git a/x/orbis/types/acp.go b/x/orbis/types/acp.go new file mode 100644 index 00000000..9894774a --- /dev/null +++ b/x/orbis/types/acp.go @@ -0,0 +1,10 @@ +package types + +const ( + ACPResourceRingPolicy = "ring_policy" + ACPResourceRing = "ring" + ACPRelationRingCreator = "ring_creator" + ACPRelationOperator = "operator" + ACPPermissionCreateRing = "create_ring" + ACPPermissionUpdateRing = "update_ring" +) diff --git a/x/orbis/types/codec.go b/x/orbis/types/codec.go new file mode 100644 index 00000000..d0a6c96a --- /dev/null +++ b/x/orbis/types/codec.go @@ -0,0 +1,22 @@ +package types + +import ( + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +// RegisterInterfaces registers module messages. +func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgCreateRing{}, + &MsgUpdateRingByAcp{}, + &MsgFinalizeRingReshareByThresholdSignature{}, + &MsgStoreDocument{}, + &MsgStoreKeyDerivation{}, + &MsgCreateNodeInfo{}, + &MsgUpdateNodeInfo{}, + &MsgUpdateParams{}, + ) + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} diff --git a/x/orbis/types/document.pb.go b/x/orbis/types/document.pb.go new file mode 100644 index 00000000..fc006ae7 --- /dev/null +++ b/x/orbis/types/document.pb.go @@ -0,0 +1,868 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: sourcehub/orbis/document.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Document stores an encrypted Orbis document and its policy binding metadata. +type Document struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + CreatorDid string `protobuf:"bytes,2,opt,name=creator_did,json=creatorDid,proto3" json:"creator_did,omitempty"` + RingId string `protobuf:"bytes,3,opt,name=ring_id,json=ringId,proto3" json:"ring_id,omitempty"` + Document string `protobuf:"bytes,4,opt,name=document,proto3" json:"document,omitempty"` + Proof string `protobuf:"bytes,5,opt,name=proof,proto3" json:"proof,omitempty"` + PolicyId string `protobuf:"bytes,6,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"` + Resource string `protobuf:"bytes,7,opt,name=resource,proto3" json:"resource,omitempty"` + Permission string `protobuf:"bytes,8,opt,name=permission,proto3" json:"permission,omitempty"` + // Types that are valid to be assigned to XTier: + // + // *Document_Tier + XTier isDocument_XTier `protobuf_oneof:"_tier"` + // Types that are valid to be assigned to XTimestamp: + // + // *Document_Timestamp + XTimestamp isDocument_XTimestamp `protobuf_oneof:"_timestamp"` +} + +func (m *Document) Reset() { *m = Document{} } +func (m *Document) String() string { return proto.CompactTextString(m) } +func (*Document) ProtoMessage() {} +func (*Document) Descriptor() ([]byte, []int) { + return fileDescriptor_c92869153d87ab26, []int{0} +} +func (m *Document) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Document) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Document.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 *Document) XXX_Merge(src proto.Message) { + xxx_messageInfo_Document.Merge(m, src) +} +func (m *Document) XXX_Size() int { + return m.Size() +} +func (m *Document) XXX_DiscardUnknown() { + xxx_messageInfo_Document.DiscardUnknown(m) +} + +var xxx_messageInfo_Document proto.InternalMessageInfo + +type isDocument_XTier interface { + isDocument_XTier() + MarshalTo([]byte) (int, error) + Size() int +} +type isDocument_XTimestamp interface { + isDocument_XTimestamp() + MarshalTo([]byte) (int, error) + Size() int +} + +type Document_Tier struct { + Tier string `protobuf:"bytes,9,opt,name=tier,proto3,oneof" json:"tier,omitempty"` +} +type Document_Timestamp struct { + Timestamp uint64 `protobuf:"varint,10,opt,name=timestamp,proto3,oneof" json:"timestamp,omitempty"` +} + +func (*Document_Tier) isDocument_XTier() {} +func (*Document_Timestamp) isDocument_XTimestamp() {} + +func (m *Document) GetXTier() isDocument_XTier { + if m != nil { + return m.XTier + } + return nil +} +func (m *Document) GetXTimestamp() isDocument_XTimestamp { + if m != nil { + return m.XTimestamp + } + return nil +} + +func (m *Document) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Document) GetCreatorDid() string { + if m != nil { + return m.CreatorDid + } + return "" +} + +func (m *Document) GetRingId() string { + if m != nil { + return m.RingId + } + return "" +} + +func (m *Document) GetDocument() string { + if m != nil { + return m.Document + } + return "" +} + +func (m *Document) GetProof() string { + if m != nil { + return m.Proof + } + return "" +} + +func (m *Document) GetPolicyId() string { + if m != nil { + return m.PolicyId + } + return "" +} + +func (m *Document) GetResource() string { + if m != nil { + return m.Resource + } + return "" +} + +func (m *Document) GetPermission() string { + if m != nil { + return m.Permission + } + return "" +} + +func (m *Document) GetTier() string { + if x, ok := m.GetXTier().(*Document_Tier); ok { + return x.Tier + } + return "" +} + +func (m *Document) GetTimestamp() uint64 { + if x, ok := m.GetXTimestamp().(*Document_Timestamp); ok { + return x.Timestamp + } + return 0 +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Document) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*Document_Tier)(nil), + (*Document_Timestamp)(nil), + } +} + +func init() { + proto.RegisterType((*Document)(nil), "sourcehub.orbis.Document") +} + +func init() { proto.RegisterFile("sourcehub/orbis/document.proto", fileDescriptor_c92869153d87ab26) } + +var fileDescriptor_c92869153d87ab26 = []byte{ + // 313 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x44, 0x91, 0x3d, 0x4e, 0x03, 0x31, + 0x10, 0x85, 0xd7, 0x4b, 0xfe, 0x76, 0x40, 0x20, 0x59, 0x48, 0xb1, 0x40, 0x32, 0x81, 0x2a, 0x55, + 0x16, 0x89, 0x1b, 0x44, 0x29, 0x02, 0x65, 0x4a, 0x9a, 0x55, 0xb2, 0x36, 0x61, 0x04, 0xbb, 0xb3, + 0xb2, 0x1d, 0x41, 0x6e, 0x90, 0x92, 0xb3, 0x70, 0x0a, 0xca, 0x94, 0x94, 0x28, 0xb9, 0x08, 0x5a, + 0x3b, 0x3f, 0xe5, 0x7b, 0xdf, 0x78, 0xfc, 0x34, 0x0f, 0xa4, 0xa5, 0x85, 0xc9, 0xf5, 0xeb, 0x62, + 0x96, 0x92, 0x99, 0xa1, 0x4d, 0x15, 0xe5, 0x8b, 0x42, 0x97, 0x6e, 0x50, 0x19, 0x72, 0xc4, 0x2f, + 0x0e, 0x7c, 0xe0, 0xf9, 0xdd, 0x77, 0x0c, 0x9d, 0xd1, 0x6e, 0x86, 0x9f, 0x43, 0x8c, 0x4a, 0xb0, + 0x1e, 0xeb, 0x27, 0x93, 0x18, 0x15, 0xbf, 0x81, 0xd3, 0xdc, 0xe8, 0xa9, 0x23, 0x93, 0x29, 0x54, + 0x22, 0xf6, 0x00, 0x76, 0xd6, 0x08, 0x15, 0xef, 0x42, 0xdb, 0x60, 0x39, 0xcf, 0x50, 0x89, 0x13, + 0x0f, 0x5b, 0xb5, 0x7c, 0x54, 0xfc, 0x0a, 0x3a, 0xfb, 0x9f, 0x45, 0xc3, 0x93, 0x83, 0xe6, 0x97, + 0xd0, 0xac, 0x0c, 0xd1, 0x8b, 0x68, 0x7a, 0x10, 0x04, 0xbf, 0x86, 0xa4, 0xa2, 0x77, 0xcc, 0x97, + 0xf5, 0xb2, 0x56, 0x78, 0x12, 0x8c, 0xb0, 0xce, 0xe8, 0x10, 0x5d, 0xb4, 0x03, 0xdb, 0x6b, 0x2e, + 0x01, 0x2a, 0x6d, 0x0a, 0xb4, 0x16, 0xa9, 0x14, 0x9d, 0x90, 0xf1, 0xe8, 0xf0, 0x2e, 0x34, 0x1c, + 0x6a, 0x23, 0x92, 0x9a, 0x8c, 0xa3, 0x89, 0x57, 0x2b, 0xc6, 0xf8, 0x2d, 0x24, 0x0e, 0x0b, 0x6d, + 0xdd, 0xb4, 0xa8, 0x04, 0xf4, 0x58, 0xbf, 0x31, 0x66, 0x93, 0xa3, 0xb5, 0x62, 0x6c, 0xd8, 0x86, + 0x66, 0x56, 0x8f, 0x0f, 0xcf, 0x00, 0xb2, 0x03, 0x19, 0x3e, 0xfd, 0x6c, 0x24, 0x5b, 0x6f, 0x24, + 0xfb, 0xdb, 0x48, 0xf6, 0xb5, 0x95, 0xd1, 0x7a, 0x2b, 0xa3, 0xdf, 0xad, 0x8c, 0x9e, 0xef, 0xe7, + 0xe8, 0xea, 0xe3, 0xe6, 0x54, 0xa4, 0x21, 0x5f, 0xa9, 0xdd, 0x07, 0x99, 0xb7, 0xf4, 0x58, 0xcc, + 0xe7, 0xae, 0x1a, 0xb7, 0xac, 0xb4, 0x9d, 0xb5, 0x7c, 0x31, 0x0f, 0xff, 0x01, 0x00, 0x00, 0xff, + 0xff, 0xaa, 0xb5, 0xc3, 0xe2, 0xba, 0x01, 0x00, 0x00, +} + +func (m *Document) 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 *Document) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Document) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XTimestamp != nil { + { + size := m.XTimestamp.Size() + i -= size + if _, err := m.XTimestamp.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.XTier != nil { + { + size := m.XTier.Size() + i -= size + if _, err := m.XTier.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.Permission) > 0 { + i -= len(m.Permission) + copy(dAtA[i:], m.Permission) + i = encodeVarintDocument(dAtA, i, uint64(len(m.Permission))) + i-- + dAtA[i] = 0x42 + } + if len(m.Resource) > 0 { + i -= len(m.Resource) + copy(dAtA[i:], m.Resource) + i = encodeVarintDocument(dAtA, i, uint64(len(m.Resource))) + i-- + dAtA[i] = 0x3a + } + if len(m.PolicyId) > 0 { + i -= len(m.PolicyId) + copy(dAtA[i:], m.PolicyId) + i = encodeVarintDocument(dAtA, i, uint64(len(m.PolicyId))) + i-- + dAtA[i] = 0x32 + } + if len(m.Proof) > 0 { + i -= len(m.Proof) + copy(dAtA[i:], m.Proof) + i = encodeVarintDocument(dAtA, i, uint64(len(m.Proof))) + i-- + dAtA[i] = 0x2a + } + if len(m.Document) > 0 { + i -= len(m.Document) + copy(dAtA[i:], m.Document) + i = encodeVarintDocument(dAtA, i, uint64(len(m.Document))) + i-- + dAtA[i] = 0x22 + } + if len(m.RingId) > 0 { + i -= len(m.RingId) + copy(dAtA[i:], m.RingId) + i = encodeVarintDocument(dAtA, i, uint64(len(m.RingId))) + i-- + dAtA[i] = 0x1a + } + if len(m.CreatorDid) > 0 { + i -= len(m.CreatorDid) + copy(dAtA[i:], m.CreatorDid) + i = encodeVarintDocument(dAtA, i, uint64(len(m.CreatorDid))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintDocument(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Document_Tier) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Document_Tier) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Tier) + copy(dAtA[i:], m.Tier) + i = encodeVarintDocument(dAtA, i, uint64(len(m.Tier))) + i-- + dAtA[i] = 0x4a + return len(dAtA) - i, nil +} +func (m *Document_Timestamp) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Document_Timestamp) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintDocument(dAtA, i, uint64(m.Timestamp)) + i-- + dAtA[i] = 0x50 + return len(dAtA) - i, nil +} +func encodeVarintDocument(dAtA []byte, offset int, v uint64) int { + offset -= sovDocument(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Document) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovDocument(uint64(l)) + } + l = len(m.CreatorDid) + if l > 0 { + n += 1 + l + sovDocument(uint64(l)) + } + l = len(m.RingId) + if l > 0 { + n += 1 + l + sovDocument(uint64(l)) + } + l = len(m.Document) + if l > 0 { + n += 1 + l + sovDocument(uint64(l)) + } + l = len(m.Proof) + if l > 0 { + n += 1 + l + sovDocument(uint64(l)) + } + l = len(m.PolicyId) + if l > 0 { + n += 1 + l + sovDocument(uint64(l)) + } + l = len(m.Resource) + if l > 0 { + n += 1 + l + sovDocument(uint64(l)) + } + l = len(m.Permission) + if l > 0 { + n += 1 + l + sovDocument(uint64(l)) + } + if m.XTier != nil { + n += m.XTier.Size() + } + if m.XTimestamp != nil { + n += m.XTimestamp.Size() + } + return n +} + +func (m *Document_Tier) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Tier) + n += 1 + l + sovDocument(uint64(l)) + return n +} +func (m *Document_Timestamp) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovDocument(uint64(m.Timestamp)) + return n +} + +func sovDocument(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozDocument(x uint64) (n int) { + return sovDocument(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Document) 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 ErrIntOverflowDocument + } + 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: Document: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Document: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatorDid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CreatorDid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RingId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RingId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Document", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Document = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proof = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PolicyId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PolicyId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resource = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Permission", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Permission = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tier", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + 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 ErrInvalidLengthDocument + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDocument + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.XTier = &Document_Tier{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDocument + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.XTimestamp = &Document_Timestamp{v} + default: + iNdEx = preIndex + skippy, err := skipDocument(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDocument + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipDocument(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowDocument + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowDocument + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowDocument + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthDocument + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupDocument + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthDocument + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthDocument = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowDocument = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupDocument = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/orbis/types/errors.go b/x/orbis/types/errors.go new file mode 100644 index 00000000..b81139d8 --- /dev/null +++ b/x/orbis/types/errors.go @@ -0,0 +1,35 @@ +package types + +import sdkerrors "cosmossdk.io/errors" + +// x/orbis module sentinel errors. +var ( + ErrInvalidSigner = sdkerrors.Register(ModuleName, 1200, "expected gov account as only signer for proposal message") + ErrInvalidRingId = sdkerrors.Register(ModuleName, 1202, "invalid ring id") + ErrInvalidDocumentId = sdkerrors.Register(ModuleName, 1203, "invalid document id") + ErrInvalidKeyDerivationId = sdkerrors.Register(ModuleName, 1204, "invalid key derivation id") + ErrInvalidRing = sdkerrors.Register(ModuleName, 1205, "invalid ring") + ErrRingAlreadyExists = sdkerrors.Register(ModuleName, 1206, "ring already exists") + ErrRingNotFound = sdkerrors.Register(ModuleName, 1207, "ring not found") + ErrDocumentAlreadyExists = sdkerrors.Register(ModuleName, 1208, "document already exists") + ErrDocumentNotFound = sdkerrors.Register(ModuleName, 1209, "document not found") + ErrKeyDerivationAlreadyExists = sdkerrors.Register(ModuleName, 1210, "key derivation already exists") + ErrKeyDerivationNotFound = sdkerrors.Register(ModuleName, 1211, "key derivation not found") + ErrInvalidDocument = sdkerrors.Register(ModuleName, 1212, "invalid document") + ErrInvalidKeyDerivation = sdkerrors.Register(ModuleName, 1213, "invalid key derivation") + ErrReshareInProgress = sdkerrors.Register(ModuleName, 1216, "reshare already in progress: finalize before changing reshare parameters") + ErrInvalidThresholdSignature = sdkerrors.Register(ModuleName, 1217, "invalid threshold signature") + ErrInvalidSignatureScheme = sdkerrors.Register(ModuleName, 1218, "invalid signature scheme") + ErrInvalidSignaturePayload = sdkerrors.Register(ModuleName, 1219, "invalid signature payload") + ErrNodeInfoAlreadyExists = sdkerrors.Register(ModuleName, 1220, "node info already exists") + ErrNodeInfoNotFound = sdkerrors.Register(ModuleName, 1221, "node info not found") + ErrInvalidNodeInfo = sdkerrors.Register(ModuleName, 1222, "invalid node info") + ErrUnauthorizedNodeInfoUpdate = sdkerrors.Register(ModuleName, 1223, "tx signer does not match controller key") + ErrRingAlreadyFinalized = sdkerrors.Register(ModuleName, 1225, "ring already has a public key set") + ErrInvalidRingFinalizer = sdkerrors.Register(ModuleName, 1226, "tx signer is not a member of the ring's peer set") + ErrDuplicateConfirmation = sdkerrors.Register(ModuleName, 1227, "node has already submitted a finalize confirmation") + ErrRingPkConflict = sdkerrors.Register(ModuleName, 1228, "submitted ring_pk conflicts with existing confirmation; ring deleted") + ErrRingNotFinalized = sdkerrors.Register(ModuleName, 1229, "ring is not finalized") + ErrUnauthorizedRingUpdate = sdkerrors.Register(ModuleName, 1230, "actor is not authorized to update ring") + ErrUnauthorizedRingCreate = sdkerrors.Register(ModuleName, 1231, "actor is not authorized to create ring") +) diff --git a/x/orbis/types/events.pb.go b/x/orbis/types/events.pb.go new file mode 100644 index 00000000..c49df4c7 --- /dev/null +++ b/x/orbis/types/events.pb.go @@ -0,0 +1,1710 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: sourcehub/orbis/events.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// EventRingCreated is emitted when a ring is created. +type EventRingCreated struct { + RingId string `protobuf:"bytes,1,opt,name=ring_id,json=ringId,proto3" json:"ring_id,omitempty"` + CreatorDid string `protobuf:"bytes,2,opt,name=creator_did,json=creatorDid,proto3" json:"creator_did,omitempty"` +} + +func (m *EventRingCreated) Reset() { *m = EventRingCreated{} } +func (m *EventRingCreated) String() string { return proto.CompactTextString(m) } +func (*EventRingCreated) ProtoMessage() {} +func (*EventRingCreated) Descriptor() ([]byte, []int) { + return fileDescriptor_cb68216cf0ba47d2, []int{0} +} +func (m *EventRingCreated) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventRingCreated) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventRingCreated.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 *EventRingCreated) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventRingCreated.Merge(m, src) +} +func (m *EventRingCreated) XXX_Size() int { + return m.Size() +} +func (m *EventRingCreated) XXX_DiscardUnknown() { + xxx_messageInfo_EventRingCreated.DiscardUnknown(m) +} + +var xxx_messageInfo_EventRingCreated proto.InternalMessageInfo + +func (m *EventRingCreated) GetRingId() string { + if m != nil { + return m.RingId + } + return "" +} + +func (m *EventRingCreated) GetCreatorDid() string { + if m != nil { + return m.CreatorDid + } + return "" +} + +// EventRingUpdated is emitted when a ring is updated in place. +type EventRingUpdated struct { + RingId string `protobuf:"bytes,1,opt,name=ring_id,json=ringId,proto3" json:"ring_id,omitempty"` + UpdaterDid string `protobuf:"bytes,2,opt,name=updater_did,json=updaterDid,proto3" json:"updater_did,omitempty"` +} + +func (m *EventRingUpdated) Reset() { *m = EventRingUpdated{} } +func (m *EventRingUpdated) String() string { return proto.CompactTextString(m) } +func (*EventRingUpdated) ProtoMessage() {} +func (*EventRingUpdated) Descriptor() ([]byte, []int) { + return fileDescriptor_cb68216cf0ba47d2, []int{1} +} +func (m *EventRingUpdated) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventRingUpdated) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventRingUpdated.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 *EventRingUpdated) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventRingUpdated.Merge(m, src) +} +func (m *EventRingUpdated) XXX_Size() int { + return m.Size() +} +func (m *EventRingUpdated) XXX_DiscardUnknown() { + xxx_messageInfo_EventRingUpdated.DiscardUnknown(m) +} + +var xxx_messageInfo_EventRingUpdated proto.InternalMessageInfo + +func (m *EventRingUpdated) GetRingId() string { + if m != nil { + return m.RingId + } + return "" +} + +func (m *EventRingUpdated) GetUpdaterDid() string { + if m != nil { + return m.UpdaterDid + } + return "" +} + +// EventDocumentStored is emitted when an encrypted document is stored. +type EventDocumentStored struct { + DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` + CreatorDid string `protobuf:"bytes,2,opt,name=creator_did,json=creatorDid,proto3" json:"creator_did,omitempty"` +} + +func (m *EventDocumentStored) Reset() { *m = EventDocumentStored{} } +func (m *EventDocumentStored) String() string { return proto.CompactTextString(m) } +func (*EventDocumentStored) ProtoMessage() {} +func (*EventDocumentStored) Descriptor() ([]byte, []int) { + return fileDescriptor_cb68216cf0ba47d2, []int{2} +} +func (m *EventDocumentStored) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventDocumentStored) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventDocumentStored.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 *EventDocumentStored) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventDocumentStored.Merge(m, src) +} +func (m *EventDocumentStored) XXX_Size() int { + return m.Size() +} +func (m *EventDocumentStored) XXX_DiscardUnknown() { + xxx_messageInfo_EventDocumentStored.DiscardUnknown(m) +} + +var xxx_messageInfo_EventDocumentStored proto.InternalMessageInfo + +func (m *EventDocumentStored) GetDocumentId() string { + if m != nil { + return m.DocumentId + } + return "" +} + +func (m *EventDocumentStored) GetCreatorDid() string { + if m != nil { + return m.CreatorDid + } + return "" +} + +// EventKeyDerivationStored is emitted when a key derivation is stored. +type EventKeyDerivationStored struct { + KeyDerivationId string `protobuf:"bytes,1,opt,name=key_derivation_id,json=keyDerivationId,proto3" json:"key_derivation_id,omitempty"` + CreatorDid string `protobuf:"bytes,2,opt,name=creator_did,json=creatorDid,proto3" json:"creator_did,omitempty"` +} + +func (m *EventKeyDerivationStored) Reset() { *m = EventKeyDerivationStored{} } +func (m *EventKeyDerivationStored) String() string { return proto.CompactTextString(m) } +func (*EventKeyDerivationStored) ProtoMessage() {} +func (*EventKeyDerivationStored) Descriptor() ([]byte, []int) { + return fileDescriptor_cb68216cf0ba47d2, []int{3} +} +func (m *EventKeyDerivationStored) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventKeyDerivationStored) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventKeyDerivationStored.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 *EventKeyDerivationStored) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventKeyDerivationStored.Merge(m, src) +} +func (m *EventKeyDerivationStored) XXX_Size() int { + return m.Size() +} +func (m *EventKeyDerivationStored) XXX_DiscardUnknown() { + xxx_messageInfo_EventKeyDerivationStored.DiscardUnknown(m) +} + +var xxx_messageInfo_EventKeyDerivationStored proto.InternalMessageInfo + +func (m *EventKeyDerivationStored) GetKeyDerivationId() string { + if m != nil { + return m.KeyDerivationId + } + return "" +} + +func (m *EventKeyDerivationStored) GetCreatorDid() string { + if m != nil { + return m.CreatorDid + } + return "" +} + +// EventNodeInfoCreated is emitted when a node info record is created. +type EventNodeInfoCreated struct { + PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` + ControllerKey string `protobuf:"bytes,2,opt,name=controller_key,json=controllerKey,proto3" json:"controller_key,omitempty"` +} + +func (m *EventNodeInfoCreated) Reset() { *m = EventNodeInfoCreated{} } +func (m *EventNodeInfoCreated) String() string { return proto.CompactTextString(m) } +func (*EventNodeInfoCreated) ProtoMessage() {} +func (*EventNodeInfoCreated) Descriptor() ([]byte, []int) { + return fileDescriptor_cb68216cf0ba47d2, []int{4} +} +func (m *EventNodeInfoCreated) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventNodeInfoCreated) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventNodeInfoCreated.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 *EventNodeInfoCreated) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventNodeInfoCreated.Merge(m, src) +} +func (m *EventNodeInfoCreated) XXX_Size() int { + return m.Size() +} +func (m *EventNodeInfoCreated) XXX_DiscardUnknown() { + xxx_messageInfo_EventNodeInfoCreated.DiscardUnknown(m) +} + +var xxx_messageInfo_EventNodeInfoCreated proto.InternalMessageInfo + +func (m *EventNodeInfoCreated) GetPeerId() string { + if m != nil { + return m.PeerId + } + return "" +} + +func (m *EventNodeInfoCreated) GetControllerKey() string { + if m != nil { + return m.ControllerKey + } + return "" +} + +// EventNodeInfoUpdated is emitted when a node info record is updated. +type EventNodeInfoUpdated struct { + PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` + ControllerKey string `protobuf:"bytes,2,opt,name=controller_key,json=controllerKey,proto3" json:"controller_key,omitempty"` +} + +func (m *EventNodeInfoUpdated) Reset() { *m = EventNodeInfoUpdated{} } +func (m *EventNodeInfoUpdated) String() string { return proto.CompactTextString(m) } +func (*EventNodeInfoUpdated) ProtoMessage() {} +func (*EventNodeInfoUpdated) Descriptor() ([]byte, []int) { + return fileDescriptor_cb68216cf0ba47d2, []int{5} +} +func (m *EventNodeInfoUpdated) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventNodeInfoUpdated) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventNodeInfoUpdated.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 *EventNodeInfoUpdated) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventNodeInfoUpdated.Merge(m, src) +} +func (m *EventNodeInfoUpdated) XXX_Size() int { + return m.Size() +} +func (m *EventNodeInfoUpdated) XXX_DiscardUnknown() { + xxx_messageInfo_EventNodeInfoUpdated.DiscardUnknown(m) +} + +var xxx_messageInfo_EventNodeInfoUpdated proto.InternalMessageInfo + +func (m *EventNodeInfoUpdated) GetPeerId() string { + if m != nil { + return m.PeerId + } + return "" +} + +func (m *EventNodeInfoUpdated) GetControllerKey() string { + if m != nil { + return m.ControllerKey + } + return "" +} + +// EventRingDeleted is emitted when a ring is removed from state. +type EventRingDeleted struct { + RingId string `protobuf:"bytes,1,opt,name=ring_id,json=ringId,proto3" json:"ring_id,omitempty"` + Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` +} + +func (m *EventRingDeleted) Reset() { *m = EventRingDeleted{} } +func (m *EventRingDeleted) String() string { return proto.CompactTextString(m) } +func (*EventRingDeleted) ProtoMessage() {} +func (*EventRingDeleted) Descriptor() ([]byte, []int) { + return fileDescriptor_cb68216cf0ba47d2, []int{6} +} +func (m *EventRingDeleted) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventRingDeleted) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventRingDeleted.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 *EventRingDeleted) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventRingDeleted.Merge(m, src) +} +func (m *EventRingDeleted) XXX_Size() int { + return m.Size() +} +func (m *EventRingDeleted) XXX_DiscardUnknown() { + xxx_messageInfo_EventRingDeleted.DiscardUnknown(m) +} + +var xxx_messageInfo_EventRingDeleted proto.InternalMessageInfo + +func (m *EventRingDeleted) GetRingId() string { + if m != nil { + return m.RingId + } + return "" +} + +func (m *EventRingDeleted) GetReason() string { + if m != nil { + return m.Reason + } + return "" +} + +func init() { + proto.RegisterType((*EventRingCreated)(nil), "sourcehub.orbis.EventRingCreated") + proto.RegisterType((*EventRingUpdated)(nil), "sourcehub.orbis.EventRingUpdated") + proto.RegisterType((*EventDocumentStored)(nil), "sourcehub.orbis.EventDocumentStored") + proto.RegisterType((*EventKeyDerivationStored)(nil), "sourcehub.orbis.EventKeyDerivationStored") + proto.RegisterType((*EventNodeInfoCreated)(nil), "sourcehub.orbis.EventNodeInfoCreated") + proto.RegisterType((*EventNodeInfoUpdated)(nil), "sourcehub.orbis.EventNodeInfoUpdated") + proto.RegisterType((*EventRingDeleted)(nil), "sourcehub.orbis.EventRingDeleted") +} + +func init() { proto.RegisterFile("sourcehub/orbis/events.proto", fileDescriptor_cb68216cf0ba47d2) } + +var fileDescriptor_cb68216cf0ba47d2 = []byte{ + // 344 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x92, 0xc1, 0x4a, 0xc3, 0x40, + 0x10, 0x86, 0x1b, 0x0f, 0x15, 0x57, 0xb4, 0x1a, 0x45, 0x7b, 0x90, 0x28, 0x82, 0x20, 0x1e, 0x1a, + 0xc1, 0x37, 0xb0, 0xf1, 0x50, 0x2b, 0x1e, 0x2a, 0x2a, 0x78, 0x09, 0x6d, 0x76, 0x8c, 0x4b, 0xda, + 0x9d, 0x30, 0xd9, 0x54, 0xf3, 0x16, 0x3e, 0x96, 0xc7, 0x1e, 0x3d, 0x4a, 0xf3, 0x22, 0x92, 0x75, + 0x6d, 0x52, 0x04, 0x2d, 0x78, 0x9c, 0x7f, 0xfe, 0xfd, 0x66, 0x99, 0xf9, 0xd9, 0x5e, 0x82, 0x29, + 0x05, 0xf0, 0x94, 0x0e, 0x5c, 0xa4, 0x81, 0x48, 0x5c, 0x18, 0x83, 0x54, 0x49, 0x2b, 0x26, 0x54, + 0x68, 0x37, 0x66, 0xdd, 0x96, 0xee, 0x1e, 0x5e, 0xb1, 0x8d, 0x8b, 0xc2, 0xd0, 0x13, 0x32, 0x6c, + 0x13, 0xf4, 0x15, 0x70, 0x7b, 0x97, 0x2d, 0x93, 0x90, 0xa1, 0x2f, 0x78, 0xd3, 0x3a, 0xb0, 0x8e, + 0x57, 0x7a, 0xf5, 0xa2, 0xec, 0x70, 0x7b, 0x9f, 0xad, 0x06, 0x85, 0x07, 0xc9, 0xe7, 0x82, 0x37, + 0x97, 0x74, 0x93, 0x19, 0xc9, 0x13, 0x7c, 0x8e, 0x76, 0x1b, 0xf3, 0x3f, 0x69, 0xa9, 0xf6, 0xcc, + 0xd1, 0x8c, 0x54, 0xd0, 0xee, 0xd9, 0x96, 0xa6, 0x79, 0x18, 0xa4, 0x23, 0x90, 0xea, 0x46, 0x21, + 0x81, 0x7e, 0xc7, 0x8d, 0x52, 0x42, 0xd9, 0xb7, 0xb4, 0xc8, 0x37, 0x43, 0xd6, 0xd4, 0xe0, 0x2e, + 0x64, 0x1e, 0x90, 0x18, 0xf7, 0x95, 0x40, 0x69, 0xe8, 0x27, 0x6c, 0x33, 0x82, 0xcc, 0xe7, 0x33, + 0xbd, 0x9c, 0xd1, 0x88, 0xaa, 0xfe, 0x45, 0x06, 0xdd, 0xb1, 0x6d, 0x3d, 0xe8, 0x1a, 0x39, 0x74, + 0xe4, 0x23, 0x56, 0x36, 0x1c, 0x03, 0x50, 0x65, 0x27, 0x45, 0xd9, 0xe1, 0xf6, 0x11, 0x5b, 0x0f, + 0x50, 0x2a, 0xc2, 0xe1, 0x10, 0xc8, 0x8f, 0x20, 0x33, 0xd0, 0xb5, 0x52, 0xed, 0x42, 0xf6, 0x83, + 0x5b, 0xd9, 0xf5, 0xbf, 0xb8, 0xed, 0xca, 0xfd, 0x3c, 0x18, 0xc2, 0xaf, 0xf7, 0xdb, 0x61, 0x75, + 0x82, 0x7e, 0x82, 0xd2, 0xb0, 0x4c, 0x75, 0x7e, 0xf9, 0x36, 0x75, 0xac, 0xc9, 0xd4, 0xb1, 0x3e, + 0xa6, 0x8e, 0xf5, 0x9a, 0x3b, 0xb5, 0x49, 0xee, 0xd4, 0xde, 0x73, 0xa7, 0xf6, 0x70, 0x1a, 0x0a, + 0x55, 0x44, 0x2f, 0xc0, 0x91, 0xfb, 0x15, 0x44, 0x09, 0xea, 0x19, 0x29, 0x72, 0xcb, 0xd0, 0xbe, + 0x98, 0xd8, 0xaa, 0x2c, 0x86, 0x64, 0x50, 0xd7, 0xb1, 0x3d, 0xfb, 0x0c, 0x00, 0x00, 0xff, 0xff, + 0xec, 0x7b, 0x29, 0x70, 0xd6, 0x02, 0x00, 0x00, +} + +func (m *EventRingCreated) 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 *EventRingCreated) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventRingCreated) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CreatorDid) > 0 { + i -= len(m.CreatorDid) + copy(dAtA[i:], m.CreatorDid) + i = encodeVarintEvents(dAtA, i, uint64(len(m.CreatorDid))) + i-- + dAtA[i] = 0x12 + } + if len(m.RingId) > 0 { + i -= len(m.RingId) + copy(dAtA[i:], m.RingId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.RingId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventRingUpdated) 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 *EventRingUpdated) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventRingUpdated) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.UpdaterDid) > 0 { + i -= len(m.UpdaterDid) + copy(dAtA[i:], m.UpdaterDid) + i = encodeVarintEvents(dAtA, i, uint64(len(m.UpdaterDid))) + i-- + dAtA[i] = 0x12 + } + if len(m.RingId) > 0 { + i -= len(m.RingId) + copy(dAtA[i:], m.RingId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.RingId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventDocumentStored) 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 *EventDocumentStored) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventDocumentStored) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CreatorDid) > 0 { + i -= len(m.CreatorDid) + copy(dAtA[i:], m.CreatorDid) + i = encodeVarintEvents(dAtA, i, uint64(len(m.CreatorDid))) + i-- + dAtA[i] = 0x12 + } + if len(m.DocumentId) > 0 { + i -= len(m.DocumentId) + copy(dAtA[i:], m.DocumentId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.DocumentId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventKeyDerivationStored) 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 *EventKeyDerivationStored) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventKeyDerivationStored) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CreatorDid) > 0 { + i -= len(m.CreatorDid) + copy(dAtA[i:], m.CreatorDid) + i = encodeVarintEvents(dAtA, i, uint64(len(m.CreatorDid))) + i-- + dAtA[i] = 0x12 + } + if len(m.KeyDerivationId) > 0 { + i -= len(m.KeyDerivationId) + copy(dAtA[i:], m.KeyDerivationId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.KeyDerivationId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventNodeInfoCreated) 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 *EventNodeInfoCreated) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventNodeInfoCreated) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ControllerKey) > 0 { + i -= len(m.ControllerKey) + copy(dAtA[i:], m.ControllerKey) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ControllerKey))) + i-- + dAtA[i] = 0x12 + } + if len(m.PeerId) > 0 { + i -= len(m.PeerId) + copy(dAtA[i:], m.PeerId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.PeerId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventNodeInfoUpdated) 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 *EventNodeInfoUpdated) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventNodeInfoUpdated) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ControllerKey) > 0 { + i -= len(m.ControllerKey) + copy(dAtA[i:], m.ControllerKey) + i = encodeVarintEvents(dAtA, i, uint64(len(m.ControllerKey))) + i-- + dAtA[i] = 0x12 + } + if len(m.PeerId) > 0 { + i -= len(m.PeerId) + copy(dAtA[i:], m.PeerId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.PeerId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventRingDeleted) 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 *EventRingDeleted) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventRingDeleted) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Reason) > 0 { + i -= len(m.Reason) + copy(dAtA[i:], m.Reason) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Reason))) + i-- + dAtA[i] = 0x12 + } + if len(m.RingId) > 0 { + i -= len(m.RingId) + copy(dAtA[i:], m.RingId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.RingId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { + offset -= sovEvents(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EventRingCreated) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RingId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.CreatorDid) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventRingUpdated) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RingId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.UpdaterDid) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventDocumentStored) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DocumentId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.CreatorDid) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventKeyDerivationStored) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.KeyDerivationId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.CreatorDid) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventNodeInfoCreated) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PeerId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.ControllerKey) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventNodeInfoUpdated) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PeerId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.ControllerKey) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventRingDeleted) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RingId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.Reason) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func sovEvents(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvents(x uint64) (n int) { + return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EventRingCreated) 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 ErrIntOverflowEvents + } + 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: EventRingCreated: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventRingCreated: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RingId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RingId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatorDid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CreatorDid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventRingUpdated) 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 ErrIntOverflowEvents + } + 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: EventRingUpdated: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventRingUpdated: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RingId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RingId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UpdaterDid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UpdaterDid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventDocumentStored) 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 ErrIntOverflowEvents + } + 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: EventDocumentStored: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventDocumentStored: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DocumentId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DocumentId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatorDid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CreatorDid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventKeyDerivationStored) 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 ErrIntOverflowEvents + } + 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: EventKeyDerivationStored: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventKeyDerivationStored: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KeyDerivationId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.KeyDerivationId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatorDid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CreatorDid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventNodeInfoCreated) 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 ErrIntOverflowEvents + } + 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: EventNodeInfoCreated: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventNodeInfoCreated: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PeerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PeerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ControllerKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ControllerKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventNodeInfoUpdated) 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 ErrIntOverflowEvents + } + 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: EventNodeInfoUpdated: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventNodeInfoUpdated: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PeerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PeerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ControllerKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ControllerKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventRingDeleted) 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 ErrIntOverflowEvents + } + 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: EventRingDeleted: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventRingDeleted: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RingId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RingId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvents(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthEvents + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvents + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvents + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/orbis/types/expected_keepers.go b/x/orbis/types/expected_keepers.go new file mode 100644 index 00000000..2cb461d8 --- /dev/null +++ b/x/orbis/types/expected_keepers.go @@ -0,0 +1,13 @@ +package types + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +type AccountKeeper interface { + GetAccount(context.Context, sdk.AccAddress) sdk.AccountI + GetModuleAccount(context.Context, string) sdk.ModuleAccountI + SetAccount(context.Context, sdk.AccountI) +} diff --git a/x/orbis/types/genesis.go b/x/orbis/types/genesis.go new file mode 100644 index 00000000..3944f423 --- /dev/null +++ b/x/orbis/types/genesis.go @@ -0,0 +1,16 @@ +package types + +// DefaultGenesis returns the default genesis state. +func DefaultGenesis() *GenesisState { + return &GenesisState{ + Params: DefaultParams(), + Rings: []Ring{}, + Documents: []Document{}, + KeyDerivations: []KeyDerivation{}, + } +} + +// Validate performs basic genesis state validation. +func (gs GenesisState) Validate() error { + return gs.Params.Validate() +} diff --git a/x/orbis/types/genesis.pb.go b/x/orbis/types/genesis.pb.go new file mode 100644 index 00000000..7b6be5b6 --- /dev/null +++ b/x/orbis/types/genesis.pb.go @@ -0,0 +1,581 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: sourcehub/orbis/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the orbis module's genesis state. +type GenesisState struct { + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + Rings []Ring `protobuf:"bytes,2,rep,name=rings,proto3" json:"rings"` + Documents []Document `protobuf:"bytes,3,rep,name=documents,proto3" json:"documents"` + KeyDerivations []KeyDerivation `protobuf:"bytes,4,rep,name=key_derivations,json=keyDerivations,proto3" json:"key_derivations"` + NodeInfos []NodeInfoEntry `protobuf:"bytes,5,rep,name=node_infos,json=nodeInfos,proto3" json:"node_infos"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_b5064b91df2d6b77, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func (m *GenesisState) GetRings() []Ring { + if m != nil { + return m.Rings + } + return nil +} + +func (m *GenesisState) GetDocuments() []Document { + if m != nil { + return m.Documents + } + return nil +} + +func (m *GenesisState) GetKeyDerivations() []KeyDerivation { + if m != nil { + return m.KeyDerivations + } + return nil +} + +func (m *GenesisState) GetNodeInfos() []NodeInfoEntry { + if m != nil { + return m.NodeInfos + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "sourcehub.orbis.GenesisState") +} + +func init() { proto.RegisterFile("sourcehub/orbis/genesis.proto", fileDescriptor_b5064b91df2d6b77) } + +var fileDescriptor_b5064b91df2d6b77 = []byte{ + // 370 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xcf, 0x4e, 0xea, 0x40, + 0x14, 0xc6, 0x5b, 0xb8, 0x90, 0x30, 0xdc, 0x5c, 0x72, 0x9b, 0x7b, 0x63, 0x6d, 0x74, 0x20, 0xc6, + 0x05, 0x71, 0xd1, 0x1a, 0x4c, 0x5c, 0xb8, 0x24, 0x18, 0xff, 0x25, 0xc6, 0xe0, 0xce, 0x0d, 0x29, + 0x74, 0xa8, 0x13, 0xd2, 0x39, 0x64, 0x66, 0x50, 0xfb, 0x16, 0x3e, 0x86, 0x4b, 0x1f, 0x83, 0x25, + 0x4b, 0x57, 0xc6, 0x80, 0x89, 0xaf, 0x61, 0x98, 0x0e, 0x50, 0x4a, 0xdc, 0x34, 0x27, 0xfd, 0x7d, + 0xdf, 0x37, 0xe7, 0x0f, 0xda, 0x15, 0x30, 0xe2, 0x3d, 0x72, 0x3f, 0xea, 0x7a, 0xc0, 0xbb, 0x54, + 0x78, 0x21, 0x61, 0x44, 0x50, 0xe1, 0x0e, 0x39, 0x48, 0xb0, 0x2a, 0x4b, 0xec, 0x2a, 0xec, 0xfc, + 0xf5, 0x23, 0xca, 0xc0, 0x53, 0xdf, 0x44, 0xe3, 0xfc, 0x0b, 0x21, 0x04, 0x55, 0x7a, 0xf3, 0x4a, + 0xff, 0xc5, 0xd9, 0xe0, 0x00, 0x7a, 0xa3, 0x88, 0x30, 0xa9, 0xf9, 0x7e, 0x96, 0x0f, 0x48, 0xdc, + 0x09, 0x08, 0xa7, 0x0f, 0xbe, 0xa4, 0xc0, 0xb4, 0xaa, 0x9a, 0x55, 0x31, 0x08, 0x48, 0x87, 0xb2, + 0xfe, 0xe2, 0x99, 0x9d, 0xac, 0x60, 0xe8, 0x73, 0x3f, 0xd2, 0xed, 0x3b, 0x4e, 0x96, 0x72, 0xca, + 0xc2, 0x84, 0xed, 0x7d, 0xe6, 0xd0, 0xef, 0xb3, 0x64, 0xd8, 0x5b, 0xe9, 0x4b, 0x62, 0x9d, 0xa0, + 0x62, 0x62, 0xb6, 0xcd, 0x9a, 0x59, 0x2f, 0x37, 0xb6, 0xdc, 0xcc, 0xf0, 0xee, 0x8d, 0xc2, 0xcd, + 0xd2, 0xf8, 0xbd, 0x6a, 0xbc, 0x7c, 0xbd, 0x1e, 0x98, 0x6d, 0xed, 0xb0, 0x8e, 0x51, 0x61, 0x1e, + 0x2d, 0xec, 0x5c, 0x2d, 0x5f, 0x2f, 0x37, 0xfe, 0x6f, 0x58, 0xdb, 0x94, 0x85, 0x69, 0x63, 0x22, + 0xb7, 0x9a, 0xa8, 0xb4, 0xd8, 0x8b, 0xb0, 0xf3, 0xca, 0xbb, 0xbd, 0xe1, 0x6d, 0x69, 0x45, 0xda, + 0xbf, 0xb2, 0x59, 0x6d, 0x54, 0x59, 0xdf, 0x9d, 0xb0, 0x7f, 0xa9, 0x24, 0xbc, 0x91, 0x74, 0x45, + 0xe2, 0xd6, 0x52, 0x96, 0x8e, 0xfb, 0x33, 0x48, 0x13, 0x61, 0x9d, 0x23, 0xb4, 0xdc, 0xb4, 0xb0, + 0x0b, 0x3f, 0xc4, 0x5d, 0x43, 0x40, 0x2e, 0x58, 0x1f, 0x4e, 0x99, 0xe4, 0xf1, 0x5a, 0x77, 0x4c, + 0x13, 0xd1, 0xbc, 0x1c, 0x4f, 0xb1, 0x39, 0x99, 0x62, 0xf3, 0x63, 0x8a, 0xcd, 0xe7, 0x19, 0x36, + 0x26, 0x33, 0x6c, 0xbc, 0xcd, 0xb0, 0x71, 0x77, 0x18, 0x52, 0x39, 0xcf, 0xea, 0x41, 0xe4, 0x25, + 0xc9, 0x8c, 0xc8, 0x47, 0xe0, 0x03, 0x6f, 0x75, 0xb5, 0x27, 0x7d, 0x37, 0x19, 0x0f, 0x89, 0xe8, + 0x16, 0xd5, 0xe5, 0x8e, 0xbe, 0x03, 0x00, 0x00, 0xff, 0xff, 0xa8, 0xef, 0x17, 0xbd, 0xb5, 0x02, + 0x00, 0x00, +} + +func (m *GenesisState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.NodeInfos) > 0 { + for iNdEx := len(m.NodeInfos) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.NodeInfos[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.KeyDerivations) > 0 { + for iNdEx := len(m.KeyDerivations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.KeyDerivations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Documents) > 0 { + for iNdEx := len(m.Documents) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Documents[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Rings) > 0 { + for iNdEx := len(m.Rings) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Rings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + if len(m.Rings) > 0 { + for _, e := range m.Rings { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.Documents) > 0 { + for _, e := range m.Documents { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.KeyDerivations) > 0 { + for _, e := range m.KeyDerivations { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.NodeInfos) > 0 { + for _, e := range m.NodeInfos { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rings", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rings = append(m.Rings, Ring{}) + if err := m.Rings[len(m.Rings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Documents", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Documents = append(m.Documents, Document{}) + if err := m.Documents[len(m.Documents)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KeyDerivations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.KeyDerivations = append(m.KeyDerivations, KeyDerivation{}) + if err := m.KeyDerivations[len(m.KeyDerivations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeInfos", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NodeInfos = append(m.NodeInfos, NodeInfoEntry{}) + if err := m.NodeInfos[len(m.NodeInfos)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/orbis/types/key_derivation.pb.go b/x/orbis/types/key_derivation.pb.go new file mode 100644 index 00000000..b9f4feb4 --- /dev/null +++ b/x/orbis/types/key_derivation.pb.go @@ -0,0 +1,630 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: sourcehub/orbis/key_derivation.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// KeyDerivation stores a signing derivation and its policy binding metadata. +type KeyDerivation struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + CreatorDid string `protobuf:"bytes,2,opt,name=creator_did,json=creatorDid,proto3" json:"creator_did,omitempty"` + RingId string `protobuf:"bytes,3,opt,name=ring_id,json=ringId,proto3" json:"ring_id,omitempty"` + Derivation string `protobuf:"bytes,4,opt,name=derivation,proto3" json:"derivation,omitempty"` + PolicyId string `protobuf:"bytes,5,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"` + Resource string `protobuf:"bytes,6,opt,name=resource,proto3" json:"resource,omitempty"` + Permission string `protobuf:"bytes,7,opt,name=permission,proto3" json:"permission,omitempty"` +} + +func (m *KeyDerivation) Reset() { *m = KeyDerivation{} } +func (m *KeyDerivation) String() string { return proto.CompactTextString(m) } +func (*KeyDerivation) ProtoMessage() {} +func (*KeyDerivation) Descriptor() ([]byte, []int) { + return fileDescriptor_4ec7b253df726179, []int{0} +} +func (m *KeyDerivation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *KeyDerivation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_KeyDerivation.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 *KeyDerivation) XXX_Merge(src proto.Message) { + xxx_messageInfo_KeyDerivation.Merge(m, src) +} +func (m *KeyDerivation) XXX_Size() int { + return m.Size() +} +func (m *KeyDerivation) XXX_DiscardUnknown() { + xxx_messageInfo_KeyDerivation.DiscardUnknown(m) +} + +var xxx_messageInfo_KeyDerivation proto.InternalMessageInfo + +func (m *KeyDerivation) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *KeyDerivation) GetCreatorDid() string { + if m != nil { + return m.CreatorDid + } + return "" +} + +func (m *KeyDerivation) GetRingId() string { + if m != nil { + return m.RingId + } + return "" +} + +func (m *KeyDerivation) GetDerivation() string { + if m != nil { + return m.Derivation + } + return "" +} + +func (m *KeyDerivation) GetPolicyId() string { + if m != nil { + return m.PolicyId + } + return "" +} + +func (m *KeyDerivation) GetResource() string { + if m != nil { + return m.Resource + } + return "" +} + +func (m *KeyDerivation) GetPermission() string { + if m != nil { + return m.Permission + } + return "" +} + +func init() { + proto.RegisterType((*KeyDerivation)(nil), "sourcehub.orbis.KeyDerivation") +} + +func init() { + proto.RegisterFile("sourcehub/orbis/key_derivation.proto", fileDescriptor_4ec7b253df726179) +} + +var fileDescriptor_4ec7b253df726179 = []byte{ + // 263 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x44, 0x90, 0xb1, 0x4e, 0xc3, 0x30, + 0x10, 0x86, 0xeb, 0x00, 0x69, 0x7b, 0x08, 0x90, 0xbc, 0x60, 0x81, 0x64, 0x10, 0x62, 0x60, 0x6a, + 0x90, 0x78, 0x03, 0xd4, 0xa5, 0xb0, 0x31, 0xb2, 0x44, 0x4d, 0x6c, 0x95, 0x53, 0x69, 0x1c, 0x9d, + 0x5d, 0x20, 0x6f, 0xc1, 0x63, 0x31, 0x56, 0x4c, 0x8c, 0x28, 0x79, 0x11, 0x64, 0xbb, 0x34, 0xe3, + 0xfd, 0xff, 0x7f, 0x9f, 0xee, 0x7e, 0xb8, 0xb6, 0x66, 0x4d, 0xa5, 0x7e, 0x59, 0x17, 0x99, 0xa1, + 0x02, 0x6d, 0xb6, 0xd4, 0x4d, 0xae, 0x34, 0xe1, 0xdb, 0xdc, 0xa1, 0xa9, 0x26, 0x35, 0x19, 0x67, + 0xf8, 0xc9, 0x2e, 0x35, 0x09, 0xa9, 0xab, 0x6f, 0x06, 0x47, 0x8f, 0xba, 0x99, 0xee, 0x82, 0xfc, + 0x18, 0x12, 0x54, 0x82, 0x5d, 0xb2, 0x9b, 0xf1, 0x53, 0x82, 0x8a, 0x5f, 0xc0, 0x61, 0x49, 0x7a, + 0xee, 0x0c, 0xe5, 0x0a, 0x95, 0x48, 0x82, 0x01, 0x5b, 0x69, 0x8a, 0x8a, 0x9f, 0xc2, 0x90, 0xb0, + 0x5a, 0xe4, 0xa8, 0xc4, 0x5e, 0x30, 0x53, 0x3f, 0xce, 0x14, 0x97, 0x00, 0xfd, 0x01, 0x62, 0x3f, + 0x2e, 0xf6, 0x0a, 0x3f, 0x87, 0x71, 0x6d, 0x5e, 0xb1, 0x6c, 0xfc, 0xea, 0x41, 0xb0, 0x47, 0x51, + 0x98, 0x29, 0x7e, 0x06, 0x23, 0xd2, 0xf1, 0x5a, 0x91, 0x46, 0xef, 0x7f, 0xf6, 0xe0, 0x5a, 0xd3, + 0x0a, 0xad, 0xf5, 0xe0, 0x61, 0x04, 0xf7, 0xca, 0xfd, 0xc3, 0x57, 0x2b, 0xd9, 0xa6, 0x95, 0xec, + 0xb7, 0x95, 0xec, 0xb3, 0x93, 0x83, 0x4d, 0x27, 0x07, 0x3f, 0x9d, 0x1c, 0x3c, 0xdf, 0x2e, 0xd0, + 0xf9, 0xe7, 0x4b, 0xb3, 0xca, 0x22, 0xac, 0xd2, 0xee, 0xdd, 0xd0, 0x32, 0xeb, 0xeb, 0xfb, 0xd8, + 0x16, 0xe8, 0x9a, 0x5a, 0xdb, 0x22, 0x0d, 0xc5, 0xdd, 0xfd, 0x05, 0x00, 0x00, 0xff, 0xff, 0xcd, + 0x22, 0xbd, 0x61, 0x60, 0x01, 0x00, 0x00, +} + +func (m *KeyDerivation) 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 *KeyDerivation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *KeyDerivation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Permission) > 0 { + i -= len(m.Permission) + copy(dAtA[i:], m.Permission) + i = encodeVarintKeyDerivation(dAtA, i, uint64(len(m.Permission))) + i-- + dAtA[i] = 0x3a + } + if len(m.Resource) > 0 { + i -= len(m.Resource) + copy(dAtA[i:], m.Resource) + i = encodeVarintKeyDerivation(dAtA, i, uint64(len(m.Resource))) + i-- + dAtA[i] = 0x32 + } + if len(m.PolicyId) > 0 { + i -= len(m.PolicyId) + copy(dAtA[i:], m.PolicyId) + i = encodeVarintKeyDerivation(dAtA, i, uint64(len(m.PolicyId))) + i-- + dAtA[i] = 0x2a + } + if len(m.Derivation) > 0 { + i -= len(m.Derivation) + copy(dAtA[i:], m.Derivation) + i = encodeVarintKeyDerivation(dAtA, i, uint64(len(m.Derivation))) + i-- + dAtA[i] = 0x22 + } + if len(m.RingId) > 0 { + i -= len(m.RingId) + copy(dAtA[i:], m.RingId) + i = encodeVarintKeyDerivation(dAtA, i, uint64(len(m.RingId))) + i-- + dAtA[i] = 0x1a + } + if len(m.CreatorDid) > 0 { + i -= len(m.CreatorDid) + copy(dAtA[i:], m.CreatorDid) + i = encodeVarintKeyDerivation(dAtA, i, uint64(len(m.CreatorDid))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintKeyDerivation(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintKeyDerivation(dAtA []byte, offset int, v uint64) int { + offset -= sovKeyDerivation(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *KeyDerivation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovKeyDerivation(uint64(l)) + } + l = len(m.CreatorDid) + if l > 0 { + n += 1 + l + sovKeyDerivation(uint64(l)) + } + l = len(m.RingId) + if l > 0 { + n += 1 + l + sovKeyDerivation(uint64(l)) + } + l = len(m.Derivation) + if l > 0 { + n += 1 + l + sovKeyDerivation(uint64(l)) + } + l = len(m.PolicyId) + if l > 0 { + n += 1 + l + sovKeyDerivation(uint64(l)) + } + l = len(m.Resource) + if l > 0 { + n += 1 + l + sovKeyDerivation(uint64(l)) + } + l = len(m.Permission) + if l > 0 { + n += 1 + l + sovKeyDerivation(uint64(l)) + } + return n +} + +func sovKeyDerivation(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozKeyDerivation(x uint64) (n int) { + return sovKeyDerivation(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *KeyDerivation) 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 ErrIntOverflowKeyDerivation + } + 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: KeyDerivation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: KeyDerivation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKeyDerivation + } + 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 ErrInvalidLengthKeyDerivation + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthKeyDerivation + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatorDid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKeyDerivation + } + 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 ErrInvalidLengthKeyDerivation + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthKeyDerivation + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CreatorDid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RingId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKeyDerivation + } + 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 ErrInvalidLengthKeyDerivation + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthKeyDerivation + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RingId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Derivation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKeyDerivation + } + 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 ErrInvalidLengthKeyDerivation + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthKeyDerivation + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Derivation = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PolicyId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKeyDerivation + } + 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 ErrInvalidLengthKeyDerivation + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthKeyDerivation + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PolicyId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKeyDerivation + } + 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 ErrInvalidLengthKeyDerivation + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthKeyDerivation + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resource = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Permission", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKeyDerivation + } + 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 ErrInvalidLengthKeyDerivation + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthKeyDerivation + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Permission = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipKeyDerivation(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthKeyDerivation + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipKeyDerivation(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowKeyDerivation + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowKeyDerivation + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowKeyDerivation + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthKeyDerivation + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupKeyDerivation + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthKeyDerivation + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthKeyDerivation = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowKeyDerivation = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupKeyDerivation = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/orbis/types/keys.go b/x/orbis/types/keys.go new file mode 100644 index 00000000..fb1d2ab0 --- /dev/null +++ b/x/orbis/types/keys.go @@ -0,0 +1,134 @@ +package types + +import ( + "crypto/sha256" + "encoding/binary" + "encoding/hex" +) + +const ( + // ModuleName defines the module name. + ModuleName = "orbis" + + // StoreKey defines the primary module store key. + StoreKey = ModuleName + + RingKeyPrefix = "ring/" + DocumentKeyPrefix = "document/" + KeyDerivationKeyPrefix = "key_derivation/" + NodeInfoKeyPrefix = "node_info/" +) + +var ( + ParamsKey = []byte("p_orbis") +) + +func KeyPrefix(p string) []byte { + return []byte(p) +} + +// GenerateRingID returns the stable ID for a ring's creation parameters. +func GenerateRingID(peerNodeKeys []string, threshold uint32, pssInterval *uint64, policyID string, nonce *string) string { + h := newIDHasher("orbis/ring/v1") + h.writeStringSlice(peerNodeKeys) + h.writeUint32(threshold) + h.writeOptionalUint64(pssInterval) + h.writeString(policyID) + h.writeOptionalString(nonce) + return h.sum() +} + +// GenerateDocumentID returns the stable ID for an encrypted document. +func GenerateDocumentID( + ringID string, + document string, + proof string, + policyID string, + resource string, + permission string, + tier *string, + timestamp *uint64, +) string { + h := newIDHasher("orbis/document/v1") + h.writeString(ringID) + h.writeString(document) + h.writeString(proof) + h.writeString(policyID) + h.writeString(resource) + h.writeString(permission) + h.writeOptionalString(tier) + h.writeOptionalUint64(timestamp) + return h.sum() +} + +// GenerateKeyDerivationID returns the stable ID for a key derivation. +func GenerateKeyDerivationID(ringID, derivation, policyID, resource, permission string) string { + h := newIDHasher("orbis/key_derivation/v1") + h.writeString(ringID) + h.writeString(derivation) + h.writeString(policyID) + h.writeString(resource) + h.writeString(permission) + return h.sum() +} + +type idHasher struct { + bytes []byte +} + +func newIDHasher(domain string) *idHasher { + h := &idHasher{} + h.writeString(domain) + return h +} + +func (h *idHasher) writeString(value string) { + h.writeBytes([]byte(value)) +} + +func (h *idHasher) writeOptionalString(value *string) { + if value == nil { + h.bytes = append(h.bytes, 0) + return + } + h.bytes = append(h.bytes, 1) + h.writeString(*value) +} + +func (h *idHasher) writeStringSlice(values []string) { + var buf [4]byte + binary.BigEndian.PutUint32(buf[:], uint32(len(values))) + h.bytes = append(h.bytes, buf[:]...) + for _, value := range values { + h.writeString(value) + } +} + +func (h *idHasher) writeUint32(value uint32) { + var buf [4]byte + binary.BigEndian.PutUint32(buf[:], value) + h.bytes = append(h.bytes, buf[:]...) +} + +func (h *idHasher) writeOptionalUint64(value *uint64) { + if value == nil { + h.bytes = append(h.bytes, 0) + return + } + h.bytes = append(h.bytes, 1) + var buf [8]byte + binary.BigEndian.PutUint64(buf[:], *value) + h.bytes = append(h.bytes, buf[:]...) +} + +func (h *idHasher) writeBytes(value []byte) { + var buf [4]byte + binary.BigEndian.PutUint32(buf[:], uint32(len(value))) + h.bytes = append(h.bytes, buf[:]...) + h.bytes = append(h.bytes, value...) +} + +func (h *idHasher) sum() string { + hash := sha256.Sum256(h.bytes) + return hex.EncodeToString(hash[:]) +} diff --git a/x/orbis/types/message_create_node_info.go b/x/orbis/types/message_create_node_info.go new file mode 100644 index 00000000..9a81da4e --- /dev/null +++ b/x/orbis/types/message_create_node_info.go @@ -0,0 +1,22 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ sdk.Msg = &MsgCreateNodeInfo{} + +func (msg *MsgCreateNodeInfo) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Creator); err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + if msg.PeerId == "" { + return errorsmod.Wrap(ErrInvalidNodeInfo, "missing peer_id") + } + if msg.ControllerKey == "" { + return errorsmod.Wrap(ErrInvalidNodeInfo, "missing controller_key") + } + return nil +} diff --git a/x/orbis/types/message_create_ring.go b/x/orbis/types/message_create_ring.go new file mode 100644 index 00000000..c5c437dd --- /dev/null +++ b/x/orbis/types/message_create_ring.go @@ -0,0 +1,34 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ sdk.Msg = &MsgCreateRing{} + +func NewMsgCreateRing(creator string, peerNodeKeys []string, threshold uint32, policyID string) *MsgCreateRing { + return &MsgCreateRing{ + Creator: creator, + PeerNodeKeys: peerNodeKeys, + Threshold: threshold, + PolicyId: policyID, + } +} + +func (msg *MsgCreateRing) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Creator); err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + if len(msg.PeerNodeKeys) == 0 { + return errorsmod.Wrap(ErrInvalidRing, "missing peer_node_keys") + } + if msg.Threshold == 0 || int(msg.Threshold) > len(msg.PeerNodeKeys) { + return errorsmod.Wrapf(ErrInvalidRing, "threshold %d is invalid for committee size %d", msg.Threshold, len(msg.PeerNodeKeys)) + } + if msg.PolicyId == "" { + return errorsmod.Wrap(ErrInvalidRing, "missing policy_id") + } + return nil +} diff --git a/x/orbis/types/message_finalize_ring.go b/x/orbis/types/message_finalize_ring.go new file mode 100644 index 00000000..9cd102ee --- /dev/null +++ b/x/orbis/types/message_finalize_ring.go @@ -0,0 +1,22 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ sdk.Msg = &MsgFinalizeRing{} + +func (msg *MsgFinalizeRing) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Creator); err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + if msg.RingId == "" { + return ErrInvalidRingId + } + if msg.RingPk == "" { + return errorsmod.Wrap(ErrInvalidRing, "missing ring_pk") + } + return nil +} diff --git a/x/bulletin/types/message_update_post_by_threshold_signature.go b/x/orbis/types/message_finalize_ring_reshare_by_threshold_signature.go similarity index 55% rename from x/bulletin/types/message_update_post_by_threshold_signature.go rename to x/orbis/types/message_finalize_ring_reshare_by_threshold_signature.go index 2d63c01e..37e08c90 100644 --- a/x/bulletin/types/message_update_post_by_threshold_signature.go +++ b/x/orbis/types/message_finalize_ring_reshare_by_threshold_signature.go @@ -6,35 +6,28 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -var _ sdk.Msg = &MsgUpdateRingPostByThresholdSignature{} +var _ sdk.Msg = &MsgFinalizeRingReshareByThresholdSignature{} -func NewMsgUpdateRingPostByThresholdSignature( +func NewMsgFinalizeRingReshareByThresholdSignature( creator string, - namespace string, - postId string, - artifact string, + ringID string, signatureScheme string, signature []byte, -) *MsgUpdateRingPostByThresholdSignature { - return &MsgUpdateRingPostByThresholdSignature{ +) *MsgFinalizeRingReshareByThresholdSignature { + return &MsgFinalizeRingReshareByThresholdSignature{ Creator: creator, - Namespace: namespace, - PostId: postId, - Artifact: artifact, + RingId: ringID, SignatureScheme: signatureScheme, Signature: signature, } } -func (msg *MsgUpdateRingPostByThresholdSignature) ValidateBasic() error { +func (msg *MsgFinalizeRingReshareByThresholdSignature) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Creator); err != nil { return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) } - if msg.Namespace == "" { - return ErrInvalidNamespaceId - } - if msg.PostId == "" { - return ErrInvalidPostId + if msg.RingId == "" { + return ErrInvalidRingId } if msg.SignatureScheme == "" { return ErrInvalidSignatureScheme diff --git a/x/orbis/types/message_store_document.go b/x/orbis/types/message_store_document.go new file mode 100644 index 00000000..702d41d8 --- /dev/null +++ b/x/orbis/types/message_store_document.go @@ -0,0 +1,40 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ sdk.Msg = &MsgStoreDocument{} + +func NewMsgStoreDocument(creator, ringID, document, proof, policyID, resource, permission string) *MsgStoreDocument { + return &MsgStoreDocument{ + Creator: creator, + RingId: ringID, + Document: document, + Proof: proof, + PolicyId: policyID, + Resource: resource, + Permission: permission, + } +} + +func (msg *MsgStoreDocument) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Creator); err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + if msg.RingId == "" { + return ErrInvalidRingId + } + if msg.Document == "" { + return errorsmod.Wrap(ErrInvalidDocument, "missing document") + } + if msg.Proof == "" { + return errorsmod.Wrap(ErrInvalidDocument, "missing proof") + } + if msg.PolicyId == "" || msg.Resource == "" || msg.Permission == "" { + return errorsmod.Wrap(ErrInvalidDocument, "missing policy binding") + } + return nil +} diff --git a/x/orbis/types/message_store_key_derivation.go b/x/orbis/types/message_store_key_derivation.go new file mode 100644 index 00000000..72fde004 --- /dev/null +++ b/x/orbis/types/message_store_key_derivation.go @@ -0,0 +1,36 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ sdk.Msg = &MsgStoreKeyDerivation{} + +func NewMsgStoreKeyDerivation(creator, ringID, derivation, policyID, resource, permission string) *MsgStoreKeyDerivation { + return &MsgStoreKeyDerivation{ + Creator: creator, + RingId: ringID, + Derivation: derivation, + PolicyId: policyID, + Resource: resource, + Permission: permission, + } +} + +func (msg *MsgStoreKeyDerivation) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Creator); err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + if msg.RingId == "" { + return ErrInvalidRingId + } + if msg.Derivation == "" { + return errorsmod.Wrap(ErrInvalidKeyDerivation, "missing derivation") + } + if msg.PolicyId == "" || msg.Resource == "" || msg.Permission == "" { + return errorsmod.Wrap(ErrInvalidKeyDerivation, "missing policy binding") + } + return nil +} diff --git a/x/orbis/types/message_update_node_info.go b/x/orbis/types/message_update_node_info.go new file mode 100644 index 00000000..70d1ee23 --- /dev/null +++ b/x/orbis/types/message_update_node_info.go @@ -0,0 +1,19 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ sdk.Msg = &MsgUpdateNodeInfo{} + +func (msg *MsgUpdateNodeInfo) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Creator); err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + if msg.NodeKey == "" { + return errorsmod.Wrap(ErrInvalidNodeInfo, "missing node_key") + } + return nil +} diff --git a/x/orbis/types/message_update_ring_by_acp.go b/x/orbis/types/message_update_ring_by_acp.go new file mode 100644 index 00000000..1befc79b --- /dev/null +++ b/x/orbis/types/message_update_ring_by_acp.go @@ -0,0 +1,26 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ sdk.Msg = &MsgUpdateRingByAcp{} + +func NewMsgUpdateRingByAcp(creator, ringID string) *MsgUpdateRingByAcp { + return &MsgUpdateRingByAcp{ + Creator: creator, + RingId: ringID, + } +} + +func (msg *MsgUpdateRingByAcp) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Creator); err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + if msg.RingId == "" { + return ErrInvalidRingId + } + return nil +} diff --git a/x/orbis/types/msg_update_params.go b/x/orbis/types/msg_update_params.go new file mode 100644 index 00000000..e36d023d --- /dev/null +++ b/x/orbis/types/msg_update_params.go @@ -0,0 +1,21 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var _ sdk.Msg = &MsgUpdateParams{} + +// ValidateBasic does a sanity check on the provided data. +func (m *MsgUpdateParams) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return errorsmod.Wrap(err, "invalid authority address") + } + + if err := m.Params.Validate(); err != nil { + return err + } + + return nil +} diff --git a/x/orbis/types/node_info.pb.go b/x/orbis/types/node_info.pb.go new file mode 100644 index 00000000..1823cce7 --- /dev/null +++ b/x/orbis/types/node_info.pb.go @@ -0,0 +1,716 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: sourcehub/orbis/node_info.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// NodeInfo stores access-control metadata for a node participating in Orbis rings. +type NodeInfo struct { + PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` + ControllerKey string `protobuf:"bytes,2,opt,name=controller_key,json=controllerKey,proto3" json:"controller_key,omitempty"` + WhitelistedPolicyIds []string `protobuf:"bytes,3,rep,name=whitelisted_policy_ids,json=whitelistedPolicyIds,proto3" json:"whitelisted_policy_ids,omitempty"` + WhitelistedRingIds []string `protobuf:"bytes,4,rep,name=whitelisted_ring_ids,json=whitelistedRingIds,proto3" json:"whitelisted_ring_ids,omitempty"` +} + +func (m *NodeInfo) Reset() { *m = NodeInfo{} } +func (m *NodeInfo) String() string { return proto.CompactTextString(m) } +func (*NodeInfo) ProtoMessage() {} +func (*NodeInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_06aa462c7d79cc8e, []int{0} +} +func (m *NodeInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NodeInfo.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 *NodeInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodeInfo.Merge(m, src) +} +func (m *NodeInfo) XXX_Size() int { + return m.Size() +} +func (m *NodeInfo) XXX_DiscardUnknown() { + xxx_messageInfo_NodeInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_NodeInfo proto.InternalMessageInfo + +func (m *NodeInfo) GetPeerId() string { + if m != nil { + return m.PeerId + } + return "" +} + +func (m *NodeInfo) GetControllerKey() string { + if m != nil { + return m.ControllerKey + } + return "" +} + +func (m *NodeInfo) GetWhitelistedPolicyIds() []string { + if m != nil { + return m.WhitelistedPolicyIds + } + return nil +} + +func (m *NodeInfo) GetWhitelistedRingIds() []string { + if m != nil { + return m.WhitelistedRingIds + } + return nil +} + +// NodeInfoEntry pairs a node_key with its NodeInfo for genesis export/import. +type NodeInfoEntry struct { + NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` + NodeInfo *NodeInfo `protobuf:"bytes,2,opt,name=node_info,json=nodeInfo,proto3" json:"node_info,omitempty"` +} + +func (m *NodeInfoEntry) Reset() { *m = NodeInfoEntry{} } +func (m *NodeInfoEntry) String() string { return proto.CompactTextString(m) } +func (*NodeInfoEntry) ProtoMessage() {} +func (*NodeInfoEntry) Descriptor() ([]byte, []int) { + return fileDescriptor_06aa462c7d79cc8e, []int{1} +} +func (m *NodeInfoEntry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NodeInfoEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NodeInfoEntry.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 *NodeInfoEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodeInfoEntry.Merge(m, src) +} +func (m *NodeInfoEntry) XXX_Size() int { + return m.Size() +} +func (m *NodeInfoEntry) XXX_DiscardUnknown() { + xxx_messageInfo_NodeInfoEntry.DiscardUnknown(m) +} + +var xxx_messageInfo_NodeInfoEntry proto.InternalMessageInfo + +func (m *NodeInfoEntry) GetNodeKey() string { + if m != nil { + return m.NodeKey + } + return "" +} + +func (m *NodeInfoEntry) GetNodeInfo() *NodeInfo { + if m != nil { + return m.NodeInfo + } + return nil +} + +func init() { + proto.RegisterType((*NodeInfo)(nil), "sourcehub.orbis.NodeInfo") + proto.RegisterType((*NodeInfoEntry)(nil), "sourcehub.orbis.NodeInfoEntry") +} + +func init() { proto.RegisterFile("sourcehub/orbis/node_info.proto", fileDescriptor_06aa462c7d79cc8e) } + +var fileDescriptor_06aa462c7d79cc8e = []byte{ + // 303 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x90, 0xcd, 0x4a, 0x3b, 0x31, + 0x14, 0xc5, 0x9b, 0x7f, 0xff, 0xf4, 0x23, 0x52, 0x85, 0x20, 0xda, 0x6e, 0x62, 0x29, 0x08, 0x5d, + 0xcd, 0x14, 0x15, 0x1f, 0x40, 0x70, 0x31, 0x0a, 0x22, 0xb3, 0x74, 0x13, 0x98, 0xc9, 0x6d, 0x1b, + 0x3a, 0xe6, 0x0e, 0x49, 0x4a, 0x9d, 0xb7, 0xf0, 0x59, 0x7c, 0x0a, 0x97, 0x5d, 0xba, 0x94, 0xf6, + 0x45, 0x24, 0xa9, 0xfd, 0xc0, 0x5d, 0xee, 0x3d, 0xf7, 0x1c, 0x4e, 0x7e, 0xf4, 0xc2, 0xe2, 0xdc, + 0xe4, 0x30, 0x9d, 0x67, 0x31, 0x9a, 0x4c, 0xd9, 0x58, 0xa3, 0x04, 0xa1, 0xf4, 0x18, 0xa3, 0xd2, + 0xa0, 0x43, 0x76, 0xb2, 0x3b, 0x88, 0xc2, 0xc1, 0xe0, 0x83, 0xd0, 0xd6, 0x13, 0x4a, 0x48, 0xf4, + 0x18, 0xd9, 0x39, 0x6d, 0x96, 0x00, 0x46, 0x28, 0xd9, 0x25, 0x7d, 0x32, 0x6c, 0xa7, 0x0d, 0x3f, + 0x26, 0x92, 0x5d, 0xd2, 0xe3, 0x1c, 0xb5, 0x33, 0x58, 0x14, 0x60, 0xc4, 0x0c, 0xaa, 0xee, 0xbf, + 0xa0, 0x77, 0xf6, 0xdb, 0x47, 0xa8, 0xd8, 0x0d, 0x3d, 0x5b, 0x4c, 0x95, 0x83, 0x42, 0x59, 0x07, + 0x52, 0x94, 0x58, 0xa8, 0xbc, 0x12, 0x4a, 0xda, 0x6e, 0xbd, 0x5f, 0x1f, 0xb6, 0xd3, 0xd3, 0x03, + 0xf5, 0x39, 0x88, 0x89, 0xb4, 0x6c, 0x44, 0x0f, 0xf7, 0xc2, 0x28, 0x3d, 0x09, 0x9e, 0xff, 0xc1, + 0xc3, 0x0e, 0xb4, 0x54, 0xe9, 0x49, 0x22, 0xed, 0x20, 0xa3, 0x9d, 0x6d, 0xe7, 0x7b, 0xed, 0x4c, + 0xc5, 0x7a, 0xb4, 0x15, 0x7e, 0xea, 0x9b, 0x6d, 0x9a, 0x37, 0xfd, 0xec, 0x3b, 0xdd, 0xd2, 0xf6, + 0x0e, 0x42, 0x68, 0x7d, 0x74, 0xd5, 0x8b, 0xfe, 0x50, 0x88, 0xb6, 0x69, 0x69, 0x88, 0xf1, 0xaf, + 0xbb, 0x87, 0xcf, 0x15, 0x27, 0xcb, 0x15, 0x27, 0xdf, 0x2b, 0x4e, 0xde, 0xd7, 0xbc, 0xb6, 0x5c, + 0xf3, 0xda, 0xd7, 0x9a, 0xd7, 0x5e, 0x46, 0x13, 0xe5, 0xbc, 0x35, 0xc7, 0xd7, 0x78, 0x13, 0xa4, + 0xc1, 0x2d, 0xd0, 0xcc, 0xe2, 0x3d, 0xfd, 0xb7, 0x5f, 0xfe, 0xae, 0x2a, 0xc1, 0x66, 0x8d, 0x00, + 0xff, 0xfa, 0x27, 0x00, 0x00, 0xff, 0xff, 0xcf, 0x9d, 0xc3, 0xe4, 0x9f, 0x01, 0x00, 0x00, +} + +func (m *NodeInfo) 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 *NodeInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodeInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.WhitelistedRingIds) > 0 { + for iNdEx := len(m.WhitelistedRingIds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.WhitelistedRingIds[iNdEx]) + copy(dAtA[i:], m.WhitelistedRingIds[iNdEx]) + i = encodeVarintNodeInfo(dAtA, i, uint64(len(m.WhitelistedRingIds[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.WhitelistedPolicyIds) > 0 { + for iNdEx := len(m.WhitelistedPolicyIds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.WhitelistedPolicyIds[iNdEx]) + copy(dAtA[i:], m.WhitelistedPolicyIds[iNdEx]) + i = encodeVarintNodeInfo(dAtA, i, uint64(len(m.WhitelistedPolicyIds[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.ControllerKey) > 0 { + i -= len(m.ControllerKey) + copy(dAtA[i:], m.ControllerKey) + i = encodeVarintNodeInfo(dAtA, i, uint64(len(m.ControllerKey))) + i-- + dAtA[i] = 0x12 + } + if len(m.PeerId) > 0 { + i -= len(m.PeerId) + copy(dAtA[i:], m.PeerId) + i = encodeVarintNodeInfo(dAtA, i, uint64(len(m.PeerId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NodeInfoEntry) 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 *NodeInfoEntry) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodeInfoEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NodeInfo != nil { + { + size, err := m.NodeInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNodeInfo(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.NodeKey) > 0 { + i -= len(m.NodeKey) + copy(dAtA[i:], m.NodeKey) + i = encodeVarintNodeInfo(dAtA, i, uint64(len(m.NodeKey))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintNodeInfo(dAtA []byte, offset int, v uint64) int { + offset -= sovNodeInfo(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *NodeInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PeerId) + if l > 0 { + n += 1 + l + sovNodeInfo(uint64(l)) + } + l = len(m.ControllerKey) + if l > 0 { + n += 1 + l + sovNodeInfo(uint64(l)) + } + if len(m.WhitelistedPolicyIds) > 0 { + for _, s := range m.WhitelistedPolicyIds { + l = len(s) + n += 1 + l + sovNodeInfo(uint64(l)) + } + } + if len(m.WhitelistedRingIds) > 0 { + for _, s := range m.WhitelistedRingIds { + l = len(s) + n += 1 + l + sovNodeInfo(uint64(l)) + } + } + return n +} + +func (m *NodeInfoEntry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.NodeKey) + if l > 0 { + n += 1 + l + sovNodeInfo(uint64(l)) + } + if m.NodeInfo != nil { + l = m.NodeInfo.Size() + n += 1 + l + sovNodeInfo(uint64(l)) + } + return n +} + +func sovNodeInfo(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozNodeInfo(x uint64) (n int) { + return sovNodeInfo(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *NodeInfo) 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 ErrIntOverflowNodeInfo + } + 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: NodeInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NodeInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PeerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNodeInfo + } + 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 ErrInvalidLengthNodeInfo + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNodeInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PeerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ControllerKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNodeInfo + } + 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 ErrInvalidLengthNodeInfo + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNodeInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ControllerKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WhitelistedPolicyIds", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNodeInfo + } + 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 ErrInvalidLengthNodeInfo + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNodeInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WhitelistedPolicyIds = append(m.WhitelistedPolicyIds, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WhitelistedRingIds", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNodeInfo + } + 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 ErrInvalidLengthNodeInfo + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNodeInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WhitelistedRingIds = append(m.WhitelistedRingIds, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNodeInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNodeInfo + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NodeInfoEntry) 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 ErrIntOverflowNodeInfo + } + 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: NodeInfoEntry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NodeInfoEntry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNodeInfo + } + 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 ErrInvalidLengthNodeInfo + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNodeInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NodeKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNodeInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNodeInfo + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNodeInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NodeInfo == nil { + m.NodeInfo = &NodeInfo{} + } + if err := m.NodeInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNodeInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNodeInfo + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipNodeInfo(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowNodeInfo + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowNodeInfo + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowNodeInfo + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthNodeInfo + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupNodeInfo + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthNodeInfo + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthNodeInfo = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowNodeInfo = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupNodeInfo = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/orbis/types/params.go b/x/orbis/types/params.go new file mode 100644 index 00000000..8f100107 --- /dev/null +++ b/x/orbis/types/params.go @@ -0,0 +1,30 @@ +package types + +import paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + +var _ paramtypes.ParamSet = (*Params)(nil) + +// ParamKeyTable returns the module param key table. +func ParamKeyTable() paramtypes.KeyTable { + return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) +} + +// NewParams creates a new Params instance. +func NewParams() Params { + return Params{} +} + +// DefaultParams returns a default set of parameters. +func DefaultParams() Params { + return NewParams() +} + +// ParamSetPairs returns the params.ParamSet. +func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { + return paramtypes.ParamSetPairs{} +} + +// Validate validates the set of params. +func (p Params) Validate() error { + return nil +} diff --git a/x/orbis/types/params.pb.go b/x/orbis/types/params.pb.go new file mode 100644 index 00000000..83cfae7c --- /dev/null +++ b/x/orbis/types/params.pb.go @@ -0,0 +1,288 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: sourcehub/orbis/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Params defines the parameters for the module. +type Params struct { +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_6fba60825128be3c, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Params)(nil), "sourcehub.orbis.Params") +} + +func init() { proto.RegisterFile("sourcehub/orbis/params.proto", fileDescriptor_6fba60825128be3c) } + +var fileDescriptor_6fba60825128be3c = []byte{ + // 172 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x29, 0xce, 0x2f, 0x2d, + 0x4a, 0x4e, 0xcd, 0x28, 0x4d, 0xd2, 0xcf, 0x2f, 0x4a, 0xca, 0x2c, 0xd6, 0x2f, 0x48, 0x2c, 0x4a, + 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x87, 0xcb, 0xea, 0x81, 0x65, 0xa5, + 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x8d, 0x94, 0x48, 0x7a, 0x7e, 0x7a, + 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x44, 0x95, 0xb4, 0xb9, 0xd8, 0x02, 0xc0, 0x26, 0x59, 0x29, + 0xbe, 0x58, 0x20, 0xcf, 0xd8, 0xf5, 0x7c, 0x83, 0x96, 0x04, 0xc2, 0xaa, 0x0a, 0xa8, 0x65, 0x10, + 0x25, 0x4e, 0x5e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, + 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x90, 0x9e, + 0x59, 0x02, 0xb2, 0x3d, 0x39, 0x3f, 0x57, 0x1f, 0xa2, 0x3d, 0x2f, 0xb5, 0xa4, 0x3c, 0xbf, 0x28, + 0x5b, 0x1f, 0xd3, 0xb0, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0xfd, 0xc6, 0x80, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xa7, 0x13, 0x5e, 0xee, 0xd9, 0x00, 0x00, 0x00, +} + +func (this *Params) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Params) + if !ok { + that2, ok := that.(Params) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} +func (m *Params) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/orbis/types/query.pb.go b/x/orbis/types/query.pb.go new file mode 100644 index 00000000..75b830fc --- /dev/null +++ b/x/orbis/types/query.pb.go @@ -0,0 +1,3496 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: sourcehub/orbis/query.proto + +package types + +import ( + context "context" + fmt "fmt" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_349198995878e248, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_349198995878e248, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +type QueryRingRequest struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *QueryRingRequest) Reset() { *m = QueryRingRequest{} } +func (m *QueryRingRequest) String() string { return proto.CompactTextString(m) } +func (*QueryRingRequest) ProtoMessage() {} +func (*QueryRingRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_349198995878e248, []int{2} +} +func (m *QueryRingRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRingRequest.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 *QueryRingRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRingRequest.Merge(m, src) +} +func (m *QueryRingRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryRingRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRingRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRingRequest proto.InternalMessageInfo + +func (m *QueryRingRequest) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +type QueryRingResponse struct { + Ring *Ring `protobuf:"bytes,1,opt,name=ring,proto3" json:"ring,omitempty"` +} + +func (m *QueryRingResponse) Reset() { *m = QueryRingResponse{} } +func (m *QueryRingResponse) String() string { return proto.CompactTextString(m) } +func (*QueryRingResponse) ProtoMessage() {} +func (*QueryRingResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_349198995878e248, []int{3} +} +func (m *QueryRingResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRingResponse.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 *QueryRingResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRingResponse.Merge(m, src) +} +func (m *QueryRingResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryRingResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRingResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRingResponse proto.InternalMessageInfo + +func (m *QueryRingResponse) GetRing() *Ring { + if m != nil { + return m.Ring + } + return nil +} + +type QueryRingsRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryRingsRequest) Reset() { *m = QueryRingsRequest{} } +func (m *QueryRingsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryRingsRequest) ProtoMessage() {} +func (*QueryRingsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_349198995878e248, []int{4} +} +func (m *QueryRingsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRingsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRingsRequest.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 *QueryRingsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRingsRequest.Merge(m, src) +} +func (m *QueryRingsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryRingsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRingsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRingsRequest proto.InternalMessageInfo + +func (m *QueryRingsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryRingsResponse struct { + Rings []Ring `protobuf:"bytes,1,rep,name=rings,proto3" json:"rings"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryRingsResponse) Reset() { *m = QueryRingsResponse{} } +func (m *QueryRingsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryRingsResponse) ProtoMessage() {} +func (*QueryRingsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_349198995878e248, []int{5} +} +func (m *QueryRingsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRingsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRingsResponse.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 *QueryRingsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRingsResponse.Merge(m, src) +} +func (m *QueryRingsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryRingsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRingsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRingsResponse proto.InternalMessageInfo + +func (m *QueryRingsResponse) GetRings() []Ring { + if m != nil { + return m.Rings + } + return nil +} + +func (m *QueryRingsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryDocumentRequest struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *QueryDocumentRequest) Reset() { *m = QueryDocumentRequest{} } +func (m *QueryDocumentRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDocumentRequest) ProtoMessage() {} +func (*QueryDocumentRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_349198995878e248, []int{6} +} +func (m *QueryDocumentRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDocumentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDocumentRequest.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 *QueryDocumentRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDocumentRequest.Merge(m, src) +} +func (m *QueryDocumentRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDocumentRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDocumentRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDocumentRequest proto.InternalMessageInfo + +func (m *QueryDocumentRequest) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +type QueryDocumentResponse struct { + Document *Document `protobuf:"bytes,1,opt,name=document,proto3" json:"document,omitempty"` +} + +func (m *QueryDocumentResponse) Reset() { *m = QueryDocumentResponse{} } +func (m *QueryDocumentResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDocumentResponse) ProtoMessage() {} +func (*QueryDocumentResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_349198995878e248, []int{7} +} +func (m *QueryDocumentResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDocumentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDocumentResponse.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 *QueryDocumentResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDocumentResponse.Merge(m, src) +} +func (m *QueryDocumentResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDocumentResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDocumentResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDocumentResponse proto.InternalMessageInfo + +func (m *QueryDocumentResponse) GetDocument() *Document { + if m != nil { + return m.Document + } + return nil +} + +type QueryDocumentsRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryDocumentsRequest) Reset() { *m = QueryDocumentsRequest{} } +func (m *QueryDocumentsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDocumentsRequest) ProtoMessage() {} +func (*QueryDocumentsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_349198995878e248, []int{8} +} +func (m *QueryDocumentsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDocumentsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDocumentsRequest.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 *QueryDocumentsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDocumentsRequest.Merge(m, src) +} +func (m *QueryDocumentsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDocumentsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDocumentsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDocumentsRequest proto.InternalMessageInfo + +func (m *QueryDocumentsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryDocumentsResponse struct { + Documents []Document `protobuf:"bytes,1,rep,name=documents,proto3" json:"documents"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryDocumentsResponse) Reset() { *m = QueryDocumentsResponse{} } +func (m *QueryDocumentsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDocumentsResponse) ProtoMessage() {} +func (*QueryDocumentsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_349198995878e248, []int{9} +} +func (m *QueryDocumentsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDocumentsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDocumentsResponse.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 *QueryDocumentsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDocumentsResponse.Merge(m, src) +} +func (m *QueryDocumentsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDocumentsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDocumentsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDocumentsResponse proto.InternalMessageInfo + +func (m *QueryDocumentsResponse) GetDocuments() []Document { + if m != nil { + return m.Documents + } + return nil +} + +func (m *QueryDocumentsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryKeyDerivationRequest struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *QueryKeyDerivationRequest) Reset() { *m = QueryKeyDerivationRequest{} } +func (m *QueryKeyDerivationRequest) String() string { return proto.CompactTextString(m) } +func (*QueryKeyDerivationRequest) ProtoMessage() {} +func (*QueryKeyDerivationRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_349198995878e248, []int{10} +} +func (m *QueryKeyDerivationRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryKeyDerivationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryKeyDerivationRequest.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 *QueryKeyDerivationRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryKeyDerivationRequest.Merge(m, src) +} +func (m *QueryKeyDerivationRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryKeyDerivationRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryKeyDerivationRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryKeyDerivationRequest proto.InternalMessageInfo + +func (m *QueryKeyDerivationRequest) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +type QueryKeyDerivationResponse struct { + KeyDerivation *KeyDerivation `protobuf:"bytes,1,opt,name=key_derivation,json=keyDerivation,proto3" json:"key_derivation,omitempty"` +} + +func (m *QueryKeyDerivationResponse) Reset() { *m = QueryKeyDerivationResponse{} } +func (m *QueryKeyDerivationResponse) String() string { return proto.CompactTextString(m) } +func (*QueryKeyDerivationResponse) ProtoMessage() {} +func (*QueryKeyDerivationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_349198995878e248, []int{11} +} +func (m *QueryKeyDerivationResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryKeyDerivationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryKeyDerivationResponse.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 *QueryKeyDerivationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryKeyDerivationResponse.Merge(m, src) +} +func (m *QueryKeyDerivationResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryKeyDerivationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryKeyDerivationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryKeyDerivationResponse proto.InternalMessageInfo + +func (m *QueryKeyDerivationResponse) GetKeyDerivation() *KeyDerivation { + if m != nil { + return m.KeyDerivation + } + return nil +} + +type QueryKeyDerivationsRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryKeyDerivationsRequest) Reset() { *m = QueryKeyDerivationsRequest{} } +func (m *QueryKeyDerivationsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryKeyDerivationsRequest) ProtoMessage() {} +func (*QueryKeyDerivationsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_349198995878e248, []int{12} +} +func (m *QueryKeyDerivationsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryKeyDerivationsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryKeyDerivationsRequest.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 *QueryKeyDerivationsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryKeyDerivationsRequest.Merge(m, src) +} +func (m *QueryKeyDerivationsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryKeyDerivationsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryKeyDerivationsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryKeyDerivationsRequest proto.InternalMessageInfo + +func (m *QueryKeyDerivationsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryKeyDerivationsResponse struct { + KeyDerivations []KeyDerivation `protobuf:"bytes,1,rep,name=key_derivations,json=keyDerivations,proto3" json:"key_derivations"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryKeyDerivationsResponse) Reset() { *m = QueryKeyDerivationsResponse{} } +func (m *QueryKeyDerivationsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryKeyDerivationsResponse) ProtoMessage() {} +func (*QueryKeyDerivationsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_349198995878e248, []int{13} +} +func (m *QueryKeyDerivationsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryKeyDerivationsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryKeyDerivationsResponse.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 *QueryKeyDerivationsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryKeyDerivationsResponse.Merge(m, src) +} +func (m *QueryKeyDerivationsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryKeyDerivationsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryKeyDerivationsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryKeyDerivationsResponse proto.InternalMessageInfo + +func (m *QueryKeyDerivationsResponse) GetKeyDerivations() []KeyDerivation { + if m != nil { + return m.KeyDerivations + } + return nil +} + +func (m *QueryKeyDerivationsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryNodeInfoRequest struct { + NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` +} + +func (m *QueryNodeInfoRequest) Reset() { *m = QueryNodeInfoRequest{} } +func (m *QueryNodeInfoRequest) String() string { return proto.CompactTextString(m) } +func (*QueryNodeInfoRequest) ProtoMessage() {} +func (*QueryNodeInfoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_349198995878e248, []int{14} +} +func (m *QueryNodeInfoRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNodeInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNodeInfoRequest.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 *QueryNodeInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNodeInfoRequest.Merge(m, src) +} +func (m *QueryNodeInfoRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryNodeInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNodeInfoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNodeInfoRequest proto.InternalMessageInfo + +func (m *QueryNodeInfoRequest) GetNodeKey() string { + if m != nil { + return m.NodeKey + } + return "" +} + +type QueryNodeInfoResponse struct { + NodeInfo *NodeInfo `protobuf:"bytes,1,opt,name=node_info,json=nodeInfo,proto3" json:"node_info,omitempty"` +} + +func (m *QueryNodeInfoResponse) Reset() { *m = QueryNodeInfoResponse{} } +func (m *QueryNodeInfoResponse) String() string { return proto.CompactTextString(m) } +func (*QueryNodeInfoResponse) ProtoMessage() {} +func (*QueryNodeInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_349198995878e248, []int{15} +} +func (m *QueryNodeInfoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNodeInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNodeInfoResponse.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 *QueryNodeInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNodeInfoResponse.Merge(m, src) +} +func (m *QueryNodeInfoResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryNodeInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNodeInfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNodeInfoResponse proto.InternalMessageInfo + +func (m *QueryNodeInfoResponse) GetNodeInfo() *NodeInfo { + if m != nil { + return m.NodeInfo + } + return nil +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "sourcehub.orbis.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "sourcehub.orbis.QueryParamsResponse") + proto.RegisterType((*QueryRingRequest)(nil), "sourcehub.orbis.QueryRingRequest") + proto.RegisterType((*QueryRingResponse)(nil), "sourcehub.orbis.QueryRingResponse") + proto.RegisterType((*QueryRingsRequest)(nil), "sourcehub.orbis.QueryRingsRequest") + proto.RegisterType((*QueryRingsResponse)(nil), "sourcehub.orbis.QueryRingsResponse") + proto.RegisterType((*QueryDocumentRequest)(nil), "sourcehub.orbis.QueryDocumentRequest") + proto.RegisterType((*QueryDocumentResponse)(nil), "sourcehub.orbis.QueryDocumentResponse") + proto.RegisterType((*QueryDocumentsRequest)(nil), "sourcehub.orbis.QueryDocumentsRequest") + proto.RegisterType((*QueryDocumentsResponse)(nil), "sourcehub.orbis.QueryDocumentsResponse") + proto.RegisterType((*QueryKeyDerivationRequest)(nil), "sourcehub.orbis.QueryKeyDerivationRequest") + proto.RegisterType((*QueryKeyDerivationResponse)(nil), "sourcehub.orbis.QueryKeyDerivationResponse") + proto.RegisterType((*QueryKeyDerivationsRequest)(nil), "sourcehub.orbis.QueryKeyDerivationsRequest") + proto.RegisterType((*QueryKeyDerivationsResponse)(nil), "sourcehub.orbis.QueryKeyDerivationsResponse") + proto.RegisterType((*QueryNodeInfoRequest)(nil), "sourcehub.orbis.QueryNodeInfoRequest") + proto.RegisterType((*QueryNodeInfoResponse)(nil), "sourcehub.orbis.QueryNodeInfoResponse") +} + +func init() { proto.RegisterFile("sourcehub/orbis/query.proto", fileDescriptor_349198995878e248) } + +var fileDescriptor_349198995878e248 = []byte{ + // 868 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4d, 0x4f, 0xdb, 0x58, + 0x14, 0x8d, 0x33, 0xc0, 0x24, 0x77, 0x44, 0x18, 0xde, 0xc0, 0xcc, 0x60, 0x46, 0x66, 0xc6, 0x40, + 0x60, 0x02, 0x63, 0xf3, 0xbd, 0x60, 0xa4, 0x59, 0x20, 0x66, 0x46, 0x2d, 0x12, 0x85, 0x2c, 0xdb, + 0x05, 0x72, 0xe2, 0x87, 0x6b, 0xa5, 0xf1, 0x0b, 0xb6, 0x43, 0x1b, 0x21, 0x5a, 0x89, 0x1f, 0xd0, + 0x56, 0xaa, 0xca, 0x1f, 0x68, 0x2b, 0x75, 0xd9, 0x75, 0x7f, 0x01, 0x4b, 0xa4, 0x6e, 0xba, 0xaa, + 0x2a, 0xa8, 0xd4, 0xbf, 0x51, 0xf9, 0xf9, 0xd9, 0xb1, 0x1d, 0x3b, 0x0e, 0x52, 0x36, 0xc8, 0xc9, + 0x3b, 0xf7, 0x9e, 0x73, 0xcf, 0x7d, 0x3e, 0x04, 0x26, 0x2d, 0xd2, 0x34, 0xab, 0xf8, 0x7e, 0xb3, + 0x22, 0x13, 0xb3, 0xa2, 0x5b, 0xf2, 0x51, 0x13, 0x9b, 0x2d, 0xa9, 0x61, 0x12, 0x9b, 0xa0, 0x11, + 0xff, 0x50, 0xa2, 0x87, 0xfc, 0xa8, 0x52, 0xd7, 0x0d, 0x22, 0xd3, 0xbf, 0x2e, 0x86, 0x2f, 0x55, + 0x89, 0x55, 0x27, 0x96, 0x5c, 0x51, 0x2c, 0xec, 0x16, 0xcb, 0xc7, 0xcb, 0x15, 0x6c, 0x2b, 0xcb, + 0x72, 0x43, 0xd1, 0x74, 0x43, 0xb1, 0x75, 0x62, 0x30, 0xec, 0x98, 0x46, 0x34, 0x42, 0x1f, 0x65, + 0xe7, 0x89, 0x7d, 0xfb, 0x9b, 0x46, 0x88, 0xf6, 0x00, 0xcb, 0x4a, 0x43, 0x97, 0x15, 0xc3, 0x20, + 0x36, 0x2d, 0xb1, 0xd8, 0xa9, 0x10, 0x15, 0xa8, 0x92, 0x6a, 0xb3, 0x8e, 0x0d, 0x9b, 0x9d, 0xcf, + 0x44, 0xcf, 0x6b, 0xb8, 0x75, 0xa0, 0x62, 0x53, 0x3f, 0x0e, 0x32, 0x4f, 0x45, 0x51, 0x06, 0x51, + 0xf1, 0x81, 0x6e, 0x1c, 0xfa, 0x22, 0xa2, 0x80, 0x86, 0x62, 0x2a, 0x75, 0x4f, 0x04, 0x1f, 0x3d, + 0x35, 0x75, 0x43, 0x73, 0xcf, 0xc4, 0x31, 0x40, 0xfb, 0xce, 0xd8, 0x7b, 0xb4, 0xa0, 0x8c, 0x8f, + 0x9a, 0xd8, 0xb2, 0xc5, 0x7d, 0xf8, 0x29, 0xf4, 0xad, 0xd5, 0x20, 0x86, 0x85, 0xd1, 0x26, 0x0c, + 0xb9, 0x8d, 0x7f, 0xe5, 0x7e, 0xe7, 0xe6, 0x7f, 0x58, 0xf9, 0x45, 0x8a, 0x58, 0x2c, 0xb9, 0x05, + 0x5b, 0xf9, 0x8b, 0x4f, 0x53, 0x99, 0xb7, 0x5f, 0xdf, 0x95, 0xb8, 0x32, 0xab, 0x10, 0x45, 0xf8, + 0x91, 0xb6, 0x2c, 0xeb, 0x86, 0xc6, 0x68, 0x50, 0x01, 0xb2, 0xba, 0x4a, 0x7b, 0xe5, 0xcb, 0x59, + 0x5d, 0x15, 0xff, 0x81, 0xd1, 0x00, 0x86, 0x91, 0xfe, 0x09, 0x03, 0x8e, 0x5e, 0x46, 0x39, 0xde, + 0x41, 0x49, 0xc1, 0x14, 0x22, 0xde, 0x0b, 0xd4, 0x7b, 0xb3, 0xa0, 0xff, 0x00, 0xda, 0xab, 0x64, + 0x5d, 0x8a, 0x92, 0xbb, 0x77, 0xc9, 0xd9, 0xbb, 0xe4, 0x5e, 0x1a, 0xb6, 0x77, 0x69, 0x4f, 0xd1, + 0x30, 0xab, 0x2d, 0x07, 0x2a, 0xc5, 0x97, 0x1c, 0xb3, 0x8a, 0x75, 0x67, 0xf2, 0x36, 0x60, 0xd0, + 0xe1, 0x76, 0x2c, 0xf9, 0x2e, 0x51, 0x5f, 0xd0, 0x10, 0x17, 0x8e, 0xfe, 0x0f, 0xc9, 0xca, 0x52, + 0x59, 0x73, 0xa9, 0xb2, 0x5c, 0xd2, 0x90, 0xae, 0x22, 0x8c, 0x51, 0x59, 0xdb, 0xec, 0x66, 0x25, + 0x99, 0xbb, 0x0b, 0xe3, 0x11, 0x1c, 0x9b, 0x60, 0x1d, 0x72, 0xde, 0xad, 0x64, 0xf6, 0x4c, 0x74, + 0x0c, 0xe1, 0x17, 0xf9, 0x50, 0xf1, 0x20, 0xd2, 0xaf, 0xef, 0x86, 0xbf, 0xe1, 0xe0, 0xe7, 0x28, + 0x03, 0x93, 0xbc, 0x05, 0x79, 0x4f, 0x87, 0x67, 0x7c, 0xb2, 0xe6, 0xa0, 0xf9, 0xed, 0xb2, 0xfe, + 0x2d, 0x60, 0x01, 0x26, 0xa8, 0xcc, 0x1d, 0xdc, 0xda, 0xf6, 0xdf, 0xdc, 0xa4, 0x2d, 0x54, 0x81, + 0x8f, 0x03, 0xb3, 0xb9, 0xfe, 0x85, 0x42, 0x38, 0x00, 0x98, 0x7d, 0x42, 0xc7, 0x70, 0xe1, 0xfa, + 0xe1, 0x5a, 0xf0, 0xa3, 0xa8, 0xc6, 0x91, 0xf4, 0x7d, 0x3f, 0xef, 0x39, 0x98, 0x8c, 0xa5, 0x61, + 0xc3, 0x94, 0x61, 0x24, 0x3c, 0x8c, 0xb7, 0xaa, 0x94, 0x69, 0x82, 0xfb, 0x2a, 0x84, 0x06, 0xeb, + 0xe3, 0xd2, 0x96, 0xd9, 0x5b, 0xb3, 0x4b, 0x54, 0x7c, 0xcb, 0x38, 0x24, 0x9e, 0x39, 0x13, 0x90, + 0xa3, 0xe1, 0x5a, 0xc3, 0x2d, 0xb6, 0xb5, 0xef, 0x9d, 0xcf, 0x3b, 0xb8, 0x25, 0xde, 0x61, 0x17, + 0xbe, 0x5d, 0xe2, 0x47, 0x40, 0xde, 0x0f, 0xe4, 0xc4, 0x37, 0xc8, 0xaf, 0xa2, 0xfd, 0x9d, 0xa7, + 0x95, 0xf3, 0x3c, 0x0c, 0xd2, 0x8e, 0xe8, 0x8c, 0x83, 0x21, 0x37, 0x3a, 0xd1, 0x74, 0x47, 0x65, + 0x67, 0x3e, 0xf3, 0x33, 0xdd, 0x41, 0xae, 0x2e, 0xf1, 0xaf, 0xb3, 0x0f, 0x5f, 0x5e, 0x64, 0xe7, + 0xd0, 0xac, 0xec, 0xa2, 0x0d, 0x6c, 0x3f, 0x24, 0x66, 0x4d, 0x8e, 0xff, 0x67, 0x81, 0x9e, 0xc0, + 0x80, 0x93, 0x55, 0xe8, 0x8f, 0xf8, 0xe6, 0x81, 0xe0, 0xe6, 0xc5, 0x6e, 0x10, 0xc6, 0xbe, 0x44, + 0xd9, 0x4b, 0x68, 0x3e, 0x85, 0xdd, 0x89, 0x43, 0xf9, 0x44, 0x57, 0x4f, 0xd1, 0x63, 0x18, 0xa4, + 0xd9, 0x8a, 0xba, 0xb4, 0xf7, 0x2d, 0x98, 0xee, 0x8a, 0x61, 0x1a, 0x16, 0xa9, 0x86, 0x22, 0x9a, + 0xe9, 0x41, 0x83, 0x85, 0x9e, 0x71, 0x90, 0xf3, 0x42, 0x03, 0xcd, 0xc6, 0xf7, 0x8f, 0xa4, 0x2c, + 0x5f, 0x4c, 0x83, 0x31, 0x25, 0x6b, 0x54, 0x89, 0x84, 0x16, 0x53, 0x94, 0x78, 0xf9, 0xe4, 0x3a, + 0xf2, 0x94, 0x83, 0xbc, 0x9f, 0x7e, 0x28, 0x85, 0xcb, 0xb7, 0x66, 0x2e, 0x15, 0x77, 0xc3, 0x15, + 0xb5, 0x43, 0xf3, 0x35, 0x07, 0xc3, 0xa1, 0x97, 0x15, 0x95, 0xe2, 0xc9, 0xe2, 0xc2, 0x90, 0x5f, + 0xe8, 0x09, 0xcb, 0xc4, 0x6d, 0x52, 0x71, 0x6b, 0x68, 0x25, 0x45, 0x5c, 0x38, 0x63, 0x5c, 0xdf, + 0x5e, 0x71, 0x50, 0x08, 0xa7, 0x12, 0xea, 0x85, 0xdb, 0x77, 0x70, 0xb1, 0x37, 0x30, 0x53, 0xba, + 0x41, 0x95, 0x2e, 0x21, 0xe9, 0x46, 0x4a, 0x2d, 0x74, 0xce, 0x41, 0xce, 0x8b, 0x85, 0xa4, 0xfb, + 0x16, 0xc9, 0xa7, 0xa4, 0xfb, 0x16, 0xcd, 0x24, 0xf1, 0x6f, 0xaa, 0x69, 0x1d, 0xad, 0xa6, 0x68, + 0xf2, 0x83, 0x4b, 0x3e, 0xf1, 0x72, 0xef, 0x74, 0xeb, 0xf6, 0xc5, 0x95, 0xc0, 0x5d, 0x5e, 0x09, + 0xdc, 0xe7, 0x2b, 0x81, 0x7b, 0x7e, 0x2d, 0x64, 0x2e, 0xaf, 0x85, 0xcc, 0xc7, 0x6b, 0x21, 0x73, + 0x77, 0x49, 0xd3, 0x6d, 0x87, 0xba, 0x4a, 0xea, 0x89, 0x8d, 0x1f, 0xb1, 0xd6, 0x76, 0xab, 0x81, + 0xad, 0xca, 0x10, 0xfd, 0x9d, 0xb9, 0xfa, 0x2d, 0x00, 0x00, 0xff, 0xff, 0xd5, 0x16, 0x36, 0x35, + 0xab, 0x0b, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Parameters queries the parameters of the module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // Ring queries a ring by id. + Ring(ctx context.Context, in *QueryRingRequest, opts ...grpc.CallOption) (*QueryRingResponse, error) + // Rings queries rings. + Rings(ctx context.Context, in *QueryRingsRequest, opts ...grpc.CallOption) (*QueryRingsResponse, error) + // Document queries an encrypted document by id. + Document(ctx context.Context, in *QueryDocumentRequest, opts ...grpc.CallOption) (*QueryDocumentResponse, error) + // Documents queries encrypted documents. + Documents(ctx context.Context, in *QueryDocumentsRequest, opts ...grpc.CallOption) (*QueryDocumentsResponse, error) + // KeyDerivation queries a key derivation by id. + KeyDerivation(ctx context.Context, in *QueryKeyDerivationRequest, opts ...grpc.CallOption) (*QueryKeyDerivationResponse, error) + // KeyDerivations queries key derivations. + KeyDerivations(ctx context.Context, in *QueryKeyDerivationsRequest, opts ...grpc.CallOption) (*QueryKeyDerivationsResponse, error) + // NodeInfo queries node info by node key. + NodeInfo(ctx context.Context, in *QueryNodeInfoRequest, opts ...grpc.CallOption) (*QueryNodeInfoResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/sourcehub.orbis.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Ring(ctx context.Context, in *QueryRingRequest, opts ...grpc.CallOption) (*QueryRingResponse, error) { + out := new(QueryRingResponse) + err := c.cc.Invoke(ctx, "/sourcehub.orbis.Query/Ring", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Rings(ctx context.Context, in *QueryRingsRequest, opts ...grpc.CallOption) (*QueryRingsResponse, error) { + out := new(QueryRingsResponse) + err := c.cc.Invoke(ctx, "/sourcehub.orbis.Query/Rings", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Document(ctx context.Context, in *QueryDocumentRequest, opts ...grpc.CallOption) (*QueryDocumentResponse, error) { + out := new(QueryDocumentResponse) + err := c.cc.Invoke(ctx, "/sourcehub.orbis.Query/Document", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Documents(ctx context.Context, in *QueryDocumentsRequest, opts ...grpc.CallOption) (*QueryDocumentsResponse, error) { + out := new(QueryDocumentsResponse) + err := c.cc.Invoke(ctx, "/sourcehub.orbis.Query/Documents", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) KeyDerivation(ctx context.Context, in *QueryKeyDerivationRequest, opts ...grpc.CallOption) (*QueryKeyDerivationResponse, error) { + out := new(QueryKeyDerivationResponse) + err := c.cc.Invoke(ctx, "/sourcehub.orbis.Query/KeyDerivation", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) KeyDerivations(ctx context.Context, in *QueryKeyDerivationsRequest, opts ...grpc.CallOption) (*QueryKeyDerivationsResponse, error) { + out := new(QueryKeyDerivationsResponse) + err := c.cc.Invoke(ctx, "/sourcehub.orbis.Query/KeyDerivations", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) NodeInfo(ctx context.Context, in *QueryNodeInfoRequest, opts ...grpc.CallOption) (*QueryNodeInfoResponse, error) { + out := new(QueryNodeInfoResponse) + err := c.cc.Invoke(ctx, "/sourcehub.orbis.Query/NodeInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Parameters queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Ring queries a ring by id. + Ring(context.Context, *QueryRingRequest) (*QueryRingResponse, error) + // Rings queries rings. + Rings(context.Context, *QueryRingsRequest) (*QueryRingsResponse, error) + // Document queries an encrypted document by id. + Document(context.Context, *QueryDocumentRequest) (*QueryDocumentResponse, error) + // Documents queries encrypted documents. + Documents(context.Context, *QueryDocumentsRequest) (*QueryDocumentsResponse, error) + // KeyDerivation queries a key derivation by id. + KeyDerivation(context.Context, *QueryKeyDerivationRequest) (*QueryKeyDerivationResponse, error) + // KeyDerivations queries key derivations. + KeyDerivations(context.Context, *QueryKeyDerivationsRequest) (*QueryKeyDerivationsResponse, error) + // NodeInfo queries node info by node key. + NodeInfo(context.Context, *QueryNodeInfoRequest) (*QueryNodeInfoResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (*UnimplementedQueryServer) Ring(ctx context.Context, req *QueryRingRequest) (*QueryRingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Ring not implemented") +} +func (*UnimplementedQueryServer) Rings(ctx context.Context, req *QueryRingsRequest) (*QueryRingsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Rings not implemented") +} +func (*UnimplementedQueryServer) Document(ctx context.Context, req *QueryDocumentRequest) (*QueryDocumentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Document not implemented") +} +func (*UnimplementedQueryServer) Documents(ctx context.Context, req *QueryDocumentsRequest) (*QueryDocumentsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Documents not implemented") +} +func (*UnimplementedQueryServer) KeyDerivation(ctx context.Context, req *QueryKeyDerivationRequest) (*QueryKeyDerivationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method KeyDerivation not implemented") +} +func (*UnimplementedQueryServer) KeyDerivations(ctx context.Context, req *QueryKeyDerivationsRequest) (*QueryKeyDerivationsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method KeyDerivations not implemented") +} +func (*UnimplementedQueryServer) NodeInfo(ctx context.Context, req *QueryNodeInfoRequest) (*QueryNodeInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NodeInfo not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sourcehub.orbis.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Ring_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Ring(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sourcehub.orbis.Query/Ring", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Ring(ctx, req.(*QueryRingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Rings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRingsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Rings(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sourcehub.orbis.Query/Rings", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Rings(ctx, req.(*QueryRingsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Document_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDocumentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Document(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sourcehub.orbis.Query/Document", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Document(ctx, req.(*QueryDocumentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Documents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDocumentsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Documents(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sourcehub.orbis.Query/Documents", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Documents(ctx, req.(*QueryDocumentsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_KeyDerivation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryKeyDerivationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).KeyDerivation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sourcehub.orbis.Query/KeyDerivation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).KeyDerivation(ctx, req.(*QueryKeyDerivationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_KeyDerivations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryKeyDerivationsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).KeyDerivations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sourcehub.orbis.Query/KeyDerivations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).KeyDerivations(ctx, req.(*QueryKeyDerivationsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_NodeInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryNodeInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).NodeInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sourcehub.orbis.Query/NodeInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).NodeInfo(ctx, req.(*QueryNodeInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var Query_serviceDesc = _Query_serviceDesc +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "sourcehub.orbis.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Ring", + Handler: _Query_Ring_Handler, + }, + { + MethodName: "Rings", + Handler: _Query_Rings_Handler, + }, + { + MethodName: "Document", + Handler: _Query_Document_Handler, + }, + { + MethodName: "Documents", + Handler: _Query_Documents_Handler, + }, + { + MethodName: "KeyDerivation", + Handler: _Query_KeyDerivation_Handler, + }, + { + MethodName: "KeyDerivations", + Handler: _Query_KeyDerivations_Handler, + }, + { + MethodName: "NodeInfo", + Handler: _Query_NodeInfo_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "sourcehub/orbis/query.proto", +} + +func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryRingRequest) 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 *QueryRingRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRingRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryRingResponse) 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 *QueryRingResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Ring != nil { + { + size, err := m.Ring.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryRingsRequest) 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 *QueryRingsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRingsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryRingsResponse) 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 *QueryRingsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRingsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Rings) > 0 { + for iNdEx := len(m.Rings) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Rings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryDocumentRequest) 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 *QueryDocumentRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDocumentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDocumentResponse) 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 *QueryDocumentResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDocumentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Document != nil { + { + size, err := m.Document.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDocumentsRequest) 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 *QueryDocumentsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDocumentsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDocumentsResponse) 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 *QueryDocumentsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDocumentsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Documents) > 0 { + for iNdEx := len(m.Documents) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Documents[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryKeyDerivationRequest) 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 *QueryKeyDerivationRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryKeyDerivationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryKeyDerivationResponse) 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 *QueryKeyDerivationResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryKeyDerivationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.KeyDerivation != nil { + { + size, err := m.KeyDerivation.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryKeyDerivationsRequest) 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 *QueryKeyDerivationsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryKeyDerivationsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryKeyDerivationsResponse) 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 *QueryKeyDerivationsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryKeyDerivationsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.KeyDerivations) > 0 { + for iNdEx := len(m.KeyDerivations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.KeyDerivations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryNodeInfoRequest) 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 *QueryNodeInfoRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNodeInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.NodeKey) > 0 { + i -= len(m.NodeKey) + copy(dAtA[i:], m.NodeKey) + i = encodeVarintQuery(dAtA, i, uint64(len(m.NodeKey))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryNodeInfoResponse) 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 *QueryNodeInfoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNodeInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NodeInfo != nil { + { + size, err := m.NodeInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryRingRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryRingResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Ring != nil { + l = m.Ring.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryRingsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryRingsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Rings) > 0 { + for _, e := range m.Rings { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDocumentRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDocumentResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Document != nil { + l = m.Document.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDocumentsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDocumentsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Documents) > 0 { + for _, e := range m.Documents { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryKeyDerivationRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryKeyDerivationResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.KeyDerivation != nil { + l = m.KeyDerivation.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryKeyDerivationsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryKeyDerivationsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.KeyDerivations) > 0 { + for _, e := range m.KeyDerivations { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryNodeInfoRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.NodeKey) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryNodeInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NodeInfo != nil { + l = m.NodeInfo.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryRingRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryRingRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRingRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryRingResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryRingResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRingResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ring", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Ring == nil { + m.Ring = &Ring{} + } + if err := m.Ring.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryRingsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryRingsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRingsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryRingsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryRingsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRingsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rings", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rings = append(m.Rings, Ring{}) + if err := m.Rings[len(m.Rings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDocumentRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDocumentRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDocumentRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDocumentResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDocumentResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDocumentResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Document", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Document == nil { + m.Document = &Document{} + } + if err := m.Document.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDocumentsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDocumentsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDocumentsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDocumentsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDocumentsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDocumentsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Documents", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Documents = append(m.Documents, Document{}) + if err := m.Documents[len(m.Documents)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryKeyDerivationRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryKeyDerivationRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryKeyDerivationRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryKeyDerivationResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryKeyDerivationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryKeyDerivationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KeyDerivation", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.KeyDerivation == nil { + m.KeyDerivation = &KeyDerivation{} + } + if err := m.KeyDerivation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryKeyDerivationsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryKeyDerivationsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryKeyDerivationsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryKeyDerivationsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryKeyDerivationsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryKeyDerivationsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KeyDerivations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.KeyDerivations = append(m.KeyDerivations, KeyDerivation{}) + if err := m.KeyDerivations[len(m.KeyDerivations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryNodeInfoRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryNodeInfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNodeInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NodeKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryNodeInfoResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryNodeInfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNodeInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NodeInfo == nil { + m.NodeInfo = &NodeInfo{} + } + if err := m.NodeInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/orbis/types/query.pb.gw.go b/x/orbis/types/query.pb.gw.go new file mode 100644 index 00000000..133ae87e --- /dev/null +++ b/x/orbis/types/query.pb.gw.go @@ -0,0 +1,806 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: sourcehub/orbis/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Ring_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRingRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.Ring(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Ring_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRingRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.Ring(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_Rings_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_Rings_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRingsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Rings_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Rings(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Rings_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRingsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Rings_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Rings(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Document_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDocumentRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.Document(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Document_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDocumentRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.Document(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_Documents_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_Documents_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDocumentsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Documents_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Documents(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Documents_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDocumentsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Documents_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Documents(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_KeyDerivation_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryKeyDerivationRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.KeyDerivation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_KeyDerivation_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryKeyDerivationRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.KeyDerivation(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_KeyDerivations_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_KeyDerivations_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryKeyDerivationsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_KeyDerivations_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.KeyDerivations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_KeyDerivations_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryKeyDerivationsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_KeyDerivations_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.KeyDerivations(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_NodeInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryNodeInfoRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["node_key"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "node_key") + } + + protoReq.NodeKey, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "node_key", err) + } + + msg, err := client.NodeInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_NodeInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryNodeInfoRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["node_key"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "node_key") + } + + protoReq.NodeKey, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "node_key", err) + } + + msg, err := server.NodeInfo(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Ring_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Ring_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Ring_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Rings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Rings_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Rings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Document_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Document_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Document_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Documents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Documents_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Documents_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_KeyDerivation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_KeyDerivation_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_KeyDerivation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_KeyDerivations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_KeyDerivations_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_KeyDerivations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_NodeInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_NodeInfo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_NodeInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Ring_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Ring_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Ring_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Rings_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Rings_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Rings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Document_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Document_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Document_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Documents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Documents_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Documents_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_KeyDerivation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_KeyDerivation_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_KeyDerivation_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_KeyDerivations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_KeyDerivations_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_KeyDerivations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_NodeInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_NodeInfo_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_NodeInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"sourcenetwork", "sourcehub", "orbis", "params"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Ring_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"sourcenetwork", "sourcehub", "orbis", "ring", "id"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Rings_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"sourcenetwork", "sourcehub", "orbis", "rings"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Document_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"sourcenetwork", "sourcehub", "orbis", "document", "id"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Documents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"sourcenetwork", "sourcehub", "orbis", "documents"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_KeyDerivation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"sourcenetwork", "sourcehub", "orbis", "key_derivation", "id"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_KeyDerivations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"sourcenetwork", "sourcehub", "orbis", "key_derivations"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_NodeInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"sourcenetwork", "sourcehub", "orbis", "node_info", "node_key"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_Ring_0 = runtime.ForwardResponseMessage + + forward_Query_Rings_0 = runtime.ForwardResponseMessage + + forward_Query_Document_0 = runtime.ForwardResponseMessage + + forward_Query_Documents_0 = runtime.ForwardResponseMessage + + forward_Query_KeyDerivation_0 = runtime.ForwardResponseMessage + + forward_Query_KeyDerivations_0 = runtime.ForwardResponseMessage + + forward_Query_NodeInfo_0 = runtime.ForwardResponseMessage +) diff --git a/x/orbis/types/ring.pb.go b/x/orbis/types/ring.pb.go new file mode 100644 index 00000000..af0d5e80 --- /dev/null +++ b/x/orbis/types/ring.pb.go @@ -0,0 +1,1117 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: sourcehub/orbis/ring.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Ring stores the active and pending committee metadata for an Orbis ring. +type Ring struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + CreatorDid string `protobuf:"bytes,2,opt,name=creator_did,json=creatorDid,proto3" json:"creator_did,omitempty"` + RingPk string `protobuf:"bytes,3,opt,name=ring_pk,json=ringPk,proto3" json:"ring_pk,omitempty"` + PeerNodeKeys []string `protobuf:"bytes,4,rep,name=peer_node_keys,json=peerNodeKeys,proto3" json:"peer_node_keys,omitempty"` + Threshold uint32 `protobuf:"varint,5,opt,name=threshold,proto3" json:"threshold,omitempty"` + NewPeerNodeKeys []string `protobuf:"bytes,6,rep,name=new_peer_node_keys,json=newPeerNodeKeys,proto3" json:"new_peer_node_keys,omitempty"` + // Types that are valid to be assigned to XNewThreshold: + // *Ring_NewThreshold + XNewThreshold isRing_XNewThreshold `protobuf_oneof:"_new_threshold"` + // Types that are valid to be assigned to XPssInterval: + // *Ring_PssInterval + XPssInterval isRing_XPssInterval `protobuf_oneof:"_pss_interval"` + BlockNumberNonce uint64 `protobuf:"varint,9,opt,name=block_number_nonce,json=blockNumberNonce,proto3" json:"block_number_nonce,omitempty"` + PolicyId string `protobuf:"bytes,10,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"` + Confirmations []*RingConfirmation `protobuf:"bytes,11,rep,name=confirmations,proto3" json:"confirmations,omitempty"` +} + +func (m *Ring) Reset() { *m = Ring{} } +func (m *Ring) String() string { return proto.CompactTextString(m) } +func (*Ring) ProtoMessage() {} +func (*Ring) Descriptor() ([]byte, []int) { + return fileDescriptor_be6c219726da9c21, []int{0} +} +func (m *Ring) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Ring) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Ring.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 *Ring) XXX_Merge(src proto.Message) { + xxx_messageInfo_Ring.Merge(m, src) +} +func (m *Ring) XXX_Size() int { + return m.Size() +} +func (m *Ring) XXX_DiscardUnknown() { + xxx_messageInfo_Ring.DiscardUnknown(m) +} + +var xxx_messageInfo_Ring proto.InternalMessageInfo + +type isRing_XNewThreshold interface { + isRing_XNewThreshold() + MarshalTo([]byte) (int, error) + Size() int +} +type isRing_XPssInterval interface { + isRing_XPssInterval() + MarshalTo([]byte) (int, error) + Size() int +} + +type Ring_NewThreshold struct { + NewThreshold uint32 `protobuf:"varint,7,opt,name=new_threshold,json=newThreshold,proto3,oneof" json:"new_threshold,omitempty"` +} +type Ring_PssInterval struct { + PssInterval uint64 `protobuf:"varint,8,opt,name=pss_interval,json=pssInterval,proto3,oneof" json:"pss_interval,omitempty"` +} + +func (*Ring_NewThreshold) isRing_XNewThreshold() {} +func (*Ring_PssInterval) isRing_XPssInterval() {} + +func (m *Ring) GetXNewThreshold() isRing_XNewThreshold { + if m != nil { + return m.XNewThreshold + } + return nil +} +func (m *Ring) GetXPssInterval() isRing_XPssInterval { + if m != nil { + return m.XPssInterval + } + return nil +} + +func (m *Ring) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Ring) GetCreatorDid() string { + if m != nil { + return m.CreatorDid + } + return "" +} + +func (m *Ring) GetRingPk() string { + if m != nil { + return m.RingPk + } + return "" +} + +func (m *Ring) GetPeerNodeKeys() []string { + if m != nil { + return m.PeerNodeKeys + } + return nil +} + +func (m *Ring) GetThreshold() uint32 { + if m != nil { + return m.Threshold + } + return 0 +} + +func (m *Ring) GetNewPeerNodeKeys() []string { + if m != nil { + return m.NewPeerNodeKeys + } + return nil +} + +func (m *Ring) GetNewThreshold() uint32 { + if x, ok := m.GetXNewThreshold().(*Ring_NewThreshold); ok { + return x.NewThreshold + } + return 0 +} + +func (m *Ring) GetPssInterval() uint64 { + if x, ok := m.GetXPssInterval().(*Ring_PssInterval); ok { + return x.PssInterval + } + return 0 +} + +func (m *Ring) GetBlockNumberNonce() uint64 { + if m != nil { + return m.BlockNumberNonce + } + return 0 +} + +func (m *Ring) GetPolicyId() string { + if m != nil { + return m.PolicyId + } + return "" +} + +func (m *Ring) GetConfirmations() []*RingConfirmation { + if m != nil { + return m.Confirmations + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Ring) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*Ring_NewThreshold)(nil), + (*Ring_PssInterval)(nil), + } +} + +// RingConfirmation records a single peer's agreement on the ring public key. +type RingConfirmation struct { + NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` + RingPk string `protobuf:"bytes,2,opt,name=ring_pk,json=ringPk,proto3" json:"ring_pk,omitempty"` +} + +func (m *RingConfirmation) Reset() { *m = RingConfirmation{} } +func (m *RingConfirmation) String() string { return proto.CompactTextString(m) } +func (*RingConfirmation) ProtoMessage() {} +func (*RingConfirmation) Descriptor() ([]byte, []int) { + return fileDescriptor_be6c219726da9c21, []int{1} +} +func (m *RingConfirmation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RingConfirmation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RingConfirmation.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 *RingConfirmation) XXX_Merge(src proto.Message) { + xxx_messageInfo_RingConfirmation.Merge(m, src) +} +func (m *RingConfirmation) XXX_Size() int { + return m.Size() +} +func (m *RingConfirmation) XXX_DiscardUnknown() { + xxx_messageInfo_RingConfirmation.DiscardUnknown(m) +} + +var xxx_messageInfo_RingConfirmation proto.InternalMessageInfo + +func (m *RingConfirmation) GetNodeKey() string { + if m != nil { + return m.NodeKey + } + return "" +} + +func (m *RingConfirmation) GetRingPk() string { + if m != nil { + return m.RingPk + } + return "" +} + +func init() { + proto.RegisterType((*Ring)(nil), "sourcehub.orbis.Ring") + proto.RegisterType((*RingConfirmation)(nil), "sourcehub.orbis.RingConfirmation") +} + +func init() { proto.RegisterFile("sourcehub/orbis/ring.proto", fileDescriptor_be6c219726da9c21) } + +var fileDescriptor_be6c219726da9c21 = []byte{ + // 430 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x92, 0xcd, 0x8e, 0xd3, 0x30, + 0x14, 0x85, 0xeb, 0xb6, 0xb4, 0xcd, 0xed, 0xaf, 0xbc, 0xc1, 0xfc, 0x28, 0x84, 0x11, 0x42, 0x91, + 0x40, 0x2d, 0x82, 0x37, 0x28, 0x08, 0x66, 0x40, 0xaa, 0x46, 0x11, 0x2b, 0x36, 0x56, 0x13, 0x9b, + 0xd6, 0x4a, 0x6b, 0x47, 0xb6, 0x4b, 0xe9, 0x1b, 0xb0, 0xe4, 0xb1, 0x10, 0xab, 0x59, 0xb2, 0x44, + 0xed, 0x8b, 0x20, 0xbb, 0x19, 0x9a, 0xe9, 0x32, 0xe7, 0x9c, 0x7c, 0xf2, 0xbd, 0xe7, 0xc2, 0x43, + 0xa3, 0x36, 0x3a, 0xe3, 0xcb, 0x4d, 0x3a, 0x51, 0x3a, 0x15, 0x66, 0xa2, 0x85, 0x5c, 0x8c, 0x0b, + 0xad, 0xac, 0xc2, 0xc3, 0xff, 0xde, 0xd8, 0x7b, 0x17, 0xbf, 0x1b, 0xd0, 0x4c, 0x84, 0x5c, 0xe0, + 0x01, 0xd4, 0x05, 0x23, 0x28, 0x42, 0x71, 0x90, 0xd4, 0x05, 0xc3, 0x4f, 0xa0, 0x9b, 0x69, 0x3e, + 0xb7, 0x4a, 0x53, 0x26, 0x18, 0xa9, 0x7b, 0x03, 0x4a, 0xe9, 0x9d, 0x60, 0xf8, 0x3e, 0xb4, 0x1d, + 0x98, 0x16, 0x39, 0x69, 0x78, 0xb3, 0xe5, 0x3e, 0xaf, 0x73, 0xfc, 0x0c, 0x06, 0x05, 0xe7, 0x9a, + 0x4a, 0xc5, 0x38, 0xcd, 0xf9, 0xce, 0x90, 0x66, 0xd4, 0x88, 0x83, 0xa4, 0xe7, 0xd4, 0x99, 0x62, + 0xfc, 0x13, 0xdf, 0x19, 0xfc, 0x18, 0x02, 0xbb, 0xd4, 0xdc, 0x2c, 0xd5, 0x8a, 0x91, 0x7b, 0x11, + 0x8a, 0xfb, 0xc9, 0x49, 0xc0, 0x2f, 0x00, 0x4b, 0xbe, 0xa5, 0x67, 0x9c, 0x96, 0xe7, 0x0c, 0x25, + 0xdf, 0x5e, 0x57, 0x51, 0x31, 0xf4, 0x5d, 0xf8, 0x84, 0x6b, 0x3b, 0xdc, 0x65, 0x2d, 0xe9, 0x49, + 0xbe, 0xfd, 0x7c, 0xab, 0xfe, 0x40, 0x08, 0x3f, 0x87, 0x5e, 0x61, 0x0c, 0x15, 0xd2, 0x72, 0xfd, + 0x6d, 0xbe, 0x22, 0x9d, 0x08, 0xc5, 0xcd, 0x4b, 0x94, 0x74, 0x0b, 0x63, 0xae, 0x4a, 0xd1, 0xe5, + 0x5e, 0x02, 0x4e, 0x57, 0x2a, 0xcb, 0xa9, 0xdc, 0xac, 0x53, 0xff, 0x04, 0x99, 0x71, 0x12, 0xb8, + 0x74, 0x32, 0xf2, 0xce, 0xcc, 0x1b, 0x33, 0xa7, 0xe3, 0x47, 0x10, 0x14, 0x6a, 0x25, 0xb2, 0x1d, + 0x15, 0x8c, 0x80, 0xdf, 0x45, 0xe7, 0x28, 0x5c, 0x31, 0xfc, 0x01, 0xfa, 0x99, 0x92, 0x5f, 0x85, + 0x5e, 0xcf, 0xad, 0x50, 0xd2, 0x90, 0x6e, 0xd4, 0x88, 0xbb, 0xaf, 0x9f, 0x8e, 0xcf, 0x9a, 0x18, + 0xbb, 0x16, 0xde, 0x56, 0x92, 0xc9, 0xdd, 0xff, 0xa6, 0x23, 0x18, 0xd0, 0x3b, 0x63, 0x4e, 0x87, + 0xd0, 0xa7, 0xd5, 0x71, 0x2e, 0xde, 0xc3, 0xe8, 0x9c, 0x82, 0x1f, 0x40, 0xe7, 0x76, 0x81, 0x65, + 0xbb, 0x6d, 0x79, 0x5c, 0x5c, 0xb5, 0xc1, 0x7a, 0xb5, 0xc1, 0xe9, 0xc7, 0x5f, 0xfb, 0x10, 0xdd, + 0xec, 0x43, 0xf4, 0x77, 0x1f, 0xa2, 0x9f, 0x87, 0xb0, 0x76, 0x73, 0x08, 0x6b, 0x7f, 0x0e, 0x61, + 0xed, 0xcb, 0xab, 0x85, 0xb0, 0xee, 0xc9, 0x99, 0x5a, 0x4f, 0x8e, 0x03, 0x48, 0x6e, 0xb7, 0x4a, + 0xe7, 0x93, 0xd3, 0xd1, 0x7d, 0x2f, 0xcf, 0xce, 0xee, 0x0a, 0x6e, 0xd2, 0x96, 0x3f, 0xbc, 0x37, + 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xf6, 0x3c, 0x85, 0xb8, 0x96, 0x02, 0x00, 0x00, +} + +func (m *Ring) 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 *Ring) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Ring) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Confirmations) > 0 { + for iNdEx := len(m.Confirmations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Confirmations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRing(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + } + if len(m.PolicyId) > 0 { + i -= len(m.PolicyId) + copy(dAtA[i:], m.PolicyId) + i = encodeVarintRing(dAtA, i, uint64(len(m.PolicyId))) + i-- + dAtA[i] = 0x52 + } + if m.BlockNumberNonce != 0 { + i = encodeVarintRing(dAtA, i, uint64(m.BlockNumberNonce)) + i-- + dAtA[i] = 0x48 + } + if m.XPssInterval != nil { + { + size := m.XPssInterval.Size() + i -= size + if _, err := m.XPssInterval.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.XNewThreshold != nil { + { + size := m.XNewThreshold.Size() + i -= size + if _, err := m.XNewThreshold.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.NewPeerNodeKeys) > 0 { + for iNdEx := len(m.NewPeerNodeKeys) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NewPeerNodeKeys[iNdEx]) + copy(dAtA[i:], m.NewPeerNodeKeys[iNdEx]) + i = encodeVarintRing(dAtA, i, uint64(len(m.NewPeerNodeKeys[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if m.Threshold != 0 { + i = encodeVarintRing(dAtA, i, uint64(m.Threshold)) + i-- + dAtA[i] = 0x28 + } + if len(m.PeerNodeKeys) > 0 { + for iNdEx := len(m.PeerNodeKeys) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.PeerNodeKeys[iNdEx]) + copy(dAtA[i:], m.PeerNodeKeys[iNdEx]) + i = encodeVarintRing(dAtA, i, uint64(len(m.PeerNodeKeys[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.RingPk) > 0 { + i -= len(m.RingPk) + copy(dAtA[i:], m.RingPk) + i = encodeVarintRing(dAtA, i, uint64(len(m.RingPk))) + i-- + dAtA[i] = 0x1a + } + if len(m.CreatorDid) > 0 { + i -= len(m.CreatorDid) + copy(dAtA[i:], m.CreatorDid) + i = encodeVarintRing(dAtA, i, uint64(len(m.CreatorDid))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintRing(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Ring_NewThreshold) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Ring_NewThreshold) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintRing(dAtA, i, uint64(m.NewThreshold)) + i-- + dAtA[i] = 0x38 + return len(dAtA) - i, nil +} +func (m *Ring_PssInterval) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Ring_PssInterval) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintRing(dAtA, i, uint64(m.PssInterval)) + i-- + dAtA[i] = 0x40 + return len(dAtA) - i, nil +} +func (m *RingConfirmation) 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 *RingConfirmation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RingConfirmation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RingPk) > 0 { + i -= len(m.RingPk) + copy(dAtA[i:], m.RingPk) + i = encodeVarintRing(dAtA, i, uint64(len(m.RingPk))) + i-- + dAtA[i] = 0x12 + } + if len(m.NodeKey) > 0 { + i -= len(m.NodeKey) + copy(dAtA[i:], m.NodeKey) + i = encodeVarintRing(dAtA, i, uint64(len(m.NodeKey))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintRing(dAtA []byte, offset int, v uint64) int { + offset -= sovRing(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Ring) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovRing(uint64(l)) + } + l = len(m.CreatorDid) + if l > 0 { + n += 1 + l + sovRing(uint64(l)) + } + l = len(m.RingPk) + if l > 0 { + n += 1 + l + sovRing(uint64(l)) + } + if len(m.PeerNodeKeys) > 0 { + for _, s := range m.PeerNodeKeys { + l = len(s) + n += 1 + l + sovRing(uint64(l)) + } + } + if m.Threshold != 0 { + n += 1 + sovRing(uint64(m.Threshold)) + } + if len(m.NewPeerNodeKeys) > 0 { + for _, s := range m.NewPeerNodeKeys { + l = len(s) + n += 1 + l + sovRing(uint64(l)) + } + } + if m.XNewThreshold != nil { + n += m.XNewThreshold.Size() + } + if m.XPssInterval != nil { + n += m.XPssInterval.Size() + } + if m.BlockNumberNonce != 0 { + n += 1 + sovRing(uint64(m.BlockNumberNonce)) + } + l = len(m.PolicyId) + if l > 0 { + n += 1 + l + sovRing(uint64(l)) + } + if len(m.Confirmations) > 0 { + for _, e := range m.Confirmations { + l = e.Size() + n += 1 + l + sovRing(uint64(l)) + } + } + return n +} + +func (m *Ring_NewThreshold) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovRing(uint64(m.NewThreshold)) + return n +} +func (m *Ring_PssInterval) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovRing(uint64(m.PssInterval)) + return n +} +func (m *RingConfirmation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.NodeKey) + if l > 0 { + n += 1 + l + sovRing(uint64(l)) + } + l = len(m.RingPk) + if l > 0 { + n += 1 + l + sovRing(uint64(l)) + } + return n +} + +func sovRing(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozRing(x uint64) (n int) { + return sovRing(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Ring) 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 ErrIntOverflowRing + } + 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: Ring: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Ring: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRing + } + 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 ErrInvalidLengthRing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatorDid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRing + } + 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 ErrInvalidLengthRing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CreatorDid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RingPk", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRing + } + 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 ErrInvalidLengthRing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RingPk = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PeerNodeKeys", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRing + } + 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 ErrInvalidLengthRing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PeerNodeKeys = append(m.PeerNodeKeys, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Threshold", wireType) + } + m.Threshold = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Threshold |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewPeerNodeKeys", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRing + } + 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 ErrInvalidLengthRing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewPeerNodeKeys = append(m.NewPeerNodeKeys, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NewThreshold", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.XNewThreshold = &Ring_NewThreshold{v} + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PssInterval", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.XPssInterval = &Ring_PssInterval{v} + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockNumberNonce", wireType) + } + m.BlockNumberNonce = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockNumberNonce |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PolicyId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRing + } + 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 ErrInvalidLengthRing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PolicyId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Confirmations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRing + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Confirmations = append(m.Confirmations, &RingConfirmation{}) + if err := m.Confirmations[len(m.Confirmations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRing(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRing + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RingConfirmation) 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 ErrIntOverflowRing + } + 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: RingConfirmation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RingConfirmation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRing + } + 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 ErrInvalidLengthRing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NodeKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RingPk", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRing + } + 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 ErrInvalidLengthRing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RingPk = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRing(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRing + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipRing(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRing + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRing + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRing + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthRing + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupRing + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthRing + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthRing = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRing = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupRing = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/orbis/types/tx.pb.go b/x/orbis/types/tx.pb.go new file mode 100644 index 00000000..38aac52a --- /dev/null +++ b/x/orbis/types/tx.pb.go @@ -0,0 +1,6638 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: sourcehub/orbis/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams struct { + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_7711ae63507074e0, []int{0} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response structure for MsgUpdateParams. +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7711ae63507074e0, []int{1} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + +type MsgCreateRing struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + PeerNodeKeys []string `protobuf:"bytes,2,rep,name=peer_node_keys,json=peerNodeKeys,proto3" json:"peer_node_keys,omitempty"` + Threshold uint32 `protobuf:"varint,3,opt,name=threshold,proto3" json:"threshold,omitempty"` + // Types that are valid to be assigned to XPssInterval: + // *MsgCreateRing_PssInterval + XPssInterval isMsgCreateRing_XPssInterval `protobuf_oneof:"_pss_interval"` + PolicyId string `protobuf:"bytes,5,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"` + // Types that are valid to be assigned to XNonce: + // *MsgCreateRing_Nonce + XNonce isMsgCreateRing_XNonce `protobuf_oneof:"_nonce"` +} + +func (m *MsgCreateRing) Reset() { *m = MsgCreateRing{} } +func (m *MsgCreateRing) String() string { return proto.CompactTextString(m) } +func (*MsgCreateRing) ProtoMessage() {} +func (*MsgCreateRing) Descriptor() ([]byte, []int) { + return fileDescriptor_7711ae63507074e0, []int{2} +} +func (m *MsgCreateRing) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateRing) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateRing.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 *MsgCreateRing) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateRing.Merge(m, src) +} +func (m *MsgCreateRing) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateRing) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateRing.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateRing proto.InternalMessageInfo + +type isMsgCreateRing_XPssInterval interface { + isMsgCreateRing_XPssInterval() + MarshalTo([]byte) (int, error) + Size() int +} +type isMsgCreateRing_XNonce interface { + isMsgCreateRing_XNonce() + MarshalTo([]byte) (int, error) + Size() int +} + +type MsgCreateRing_PssInterval struct { + PssInterval uint64 `protobuf:"varint,4,opt,name=pss_interval,json=pssInterval,proto3,oneof" json:"pss_interval,omitempty"` +} +type MsgCreateRing_Nonce struct { + Nonce string `protobuf:"bytes,6,opt,name=nonce,proto3,oneof" json:"nonce,omitempty"` +} + +func (*MsgCreateRing_PssInterval) isMsgCreateRing_XPssInterval() {} +func (*MsgCreateRing_Nonce) isMsgCreateRing_XNonce() {} + +func (m *MsgCreateRing) GetXPssInterval() isMsgCreateRing_XPssInterval { + if m != nil { + return m.XPssInterval + } + return nil +} +func (m *MsgCreateRing) GetXNonce() isMsgCreateRing_XNonce { + if m != nil { + return m.XNonce + } + return nil +} + +func (m *MsgCreateRing) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgCreateRing) GetPeerNodeKeys() []string { + if m != nil { + return m.PeerNodeKeys + } + return nil +} + +func (m *MsgCreateRing) GetThreshold() uint32 { + if m != nil { + return m.Threshold + } + return 0 +} + +func (m *MsgCreateRing) GetPssInterval() uint64 { + if x, ok := m.GetXPssInterval().(*MsgCreateRing_PssInterval); ok { + return x.PssInterval + } + return 0 +} + +func (m *MsgCreateRing) GetPolicyId() string { + if m != nil { + return m.PolicyId + } + return "" +} + +func (m *MsgCreateRing) GetNonce() string { + if x, ok := m.GetXNonce().(*MsgCreateRing_Nonce); ok { + return x.Nonce + } + return "" +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*MsgCreateRing) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*MsgCreateRing_PssInterval)(nil), + (*MsgCreateRing_Nonce)(nil), + } +} + +type MsgCreateRingResponse struct { + RingId string `protobuf:"bytes,1,opt,name=ring_id,json=ringId,proto3" json:"ring_id,omitempty"` +} + +func (m *MsgCreateRingResponse) Reset() { *m = MsgCreateRingResponse{} } +func (m *MsgCreateRingResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateRingResponse) ProtoMessage() {} +func (*MsgCreateRingResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7711ae63507074e0, []int{3} +} +func (m *MsgCreateRingResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateRingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateRingResponse.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 *MsgCreateRingResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateRingResponse.Merge(m, src) +} +func (m *MsgCreateRingResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateRingResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateRingResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateRingResponse proto.InternalMessageInfo + +func (m *MsgCreateRingResponse) GetRingId() string { + if m != nil { + return m.RingId + } + return "" +} + +type MsgFinalizeRing struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + RingId string `protobuf:"bytes,2,opt,name=ring_id,json=ringId,proto3" json:"ring_id,omitempty"` + RingPk string `protobuf:"bytes,3,opt,name=ring_pk,json=ringPk,proto3" json:"ring_pk,omitempty"` +} + +func (m *MsgFinalizeRing) Reset() { *m = MsgFinalizeRing{} } +func (m *MsgFinalizeRing) String() string { return proto.CompactTextString(m) } +func (*MsgFinalizeRing) ProtoMessage() {} +func (*MsgFinalizeRing) Descriptor() ([]byte, []int) { + return fileDescriptor_7711ae63507074e0, []int{4} +} +func (m *MsgFinalizeRing) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgFinalizeRing) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgFinalizeRing.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 *MsgFinalizeRing) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgFinalizeRing.Merge(m, src) +} +func (m *MsgFinalizeRing) XXX_Size() int { + return m.Size() +} +func (m *MsgFinalizeRing) XXX_DiscardUnknown() { + xxx_messageInfo_MsgFinalizeRing.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgFinalizeRing proto.InternalMessageInfo + +func (m *MsgFinalizeRing) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgFinalizeRing) GetRingId() string { + if m != nil { + return m.RingId + } + return "" +} + +func (m *MsgFinalizeRing) GetRingPk() string { + if m != nil { + return m.RingPk + } + return "" +} + +type MsgFinalizeRingResponse struct { +} + +func (m *MsgFinalizeRingResponse) Reset() { *m = MsgFinalizeRingResponse{} } +func (m *MsgFinalizeRingResponse) String() string { return proto.CompactTextString(m) } +func (*MsgFinalizeRingResponse) ProtoMessage() {} +func (*MsgFinalizeRingResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7711ae63507074e0, []int{5} +} +func (m *MsgFinalizeRingResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgFinalizeRingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgFinalizeRingResponse.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 *MsgFinalizeRingResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgFinalizeRingResponse.Merge(m, src) +} +func (m *MsgFinalizeRingResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgFinalizeRingResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgFinalizeRingResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgFinalizeRingResponse proto.InternalMessageInfo + +type MsgUpdateRingByAcp struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + RingId string `protobuf:"bytes,2,opt,name=ring_id,json=ringId,proto3" json:"ring_id,omitempty"` + NewPeerNodeKeys []string `protobuf:"bytes,3,rep,name=new_peer_node_keys,json=newPeerNodeKeys,proto3" json:"new_peer_node_keys,omitempty"` + // Types that are valid to be assigned to XNewThreshold: + // + // *MsgUpdateRingByAcp_NewThreshold + XNewThreshold isMsgUpdateRingByAcp_XNewThreshold `protobuf_oneof:"_new_threshold"` + // Types that are valid to be assigned to XPssInterval: + // + // *MsgUpdateRingByAcp_PssInterval + XPssInterval isMsgUpdateRingByAcp_XPssInterval `protobuf_oneof:"_pss_interval"` +} + +func (m *MsgUpdateRingByAcp) Reset() { *m = MsgUpdateRingByAcp{} } +func (m *MsgUpdateRingByAcp) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateRingByAcp) ProtoMessage() {} +func (*MsgUpdateRingByAcp) Descriptor() ([]byte, []int) { + return fileDescriptor_7711ae63507074e0, []int{6} +} +func (m *MsgUpdateRingByAcp) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateRingByAcp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateRingByAcp.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 *MsgUpdateRingByAcp) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateRingByAcp.Merge(m, src) +} +func (m *MsgUpdateRingByAcp) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateRingByAcp) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateRingByAcp.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateRingByAcp proto.InternalMessageInfo + +type isMsgUpdateRingByAcp_XNewThreshold interface { + isMsgUpdateRingByAcp_XNewThreshold() + MarshalTo([]byte) (int, error) + Size() int +} +type isMsgUpdateRingByAcp_XPssInterval interface { + isMsgUpdateRingByAcp_XPssInterval() + MarshalTo([]byte) (int, error) + Size() int +} + +type MsgUpdateRingByAcp_NewThreshold struct { + NewThreshold uint32 `protobuf:"varint,4,opt,name=new_threshold,json=newThreshold,proto3,oneof" json:"new_threshold,omitempty"` +} +type MsgUpdateRingByAcp_PssInterval struct { + PssInterval uint64 `protobuf:"varint,5,opt,name=pss_interval,json=pssInterval,proto3,oneof" json:"pss_interval,omitempty"` +} + +func (*MsgUpdateRingByAcp_NewThreshold) isMsgUpdateRingByAcp_XNewThreshold() {} +func (*MsgUpdateRingByAcp_PssInterval) isMsgUpdateRingByAcp_XPssInterval() {} + +func (m *MsgUpdateRingByAcp) GetXNewThreshold() isMsgUpdateRingByAcp_XNewThreshold { + if m != nil { + return m.XNewThreshold + } + return nil +} +func (m *MsgUpdateRingByAcp) GetXPssInterval() isMsgUpdateRingByAcp_XPssInterval { + if m != nil { + return m.XPssInterval + } + return nil +} + +func (m *MsgUpdateRingByAcp) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgUpdateRingByAcp) GetRingId() string { + if m != nil { + return m.RingId + } + return "" +} + +func (m *MsgUpdateRingByAcp) GetNewPeerNodeKeys() []string { + if m != nil { + return m.NewPeerNodeKeys + } + return nil +} + +func (m *MsgUpdateRingByAcp) GetNewThreshold() uint32 { + if x, ok := m.GetXNewThreshold().(*MsgUpdateRingByAcp_NewThreshold); ok { + return x.NewThreshold + } + return 0 +} + +func (m *MsgUpdateRingByAcp) GetPssInterval() uint64 { + if x, ok := m.GetXPssInterval().(*MsgUpdateRingByAcp_PssInterval); ok { + return x.PssInterval + } + return 0 +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*MsgUpdateRingByAcp) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*MsgUpdateRingByAcp_NewThreshold)(nil), + (*MsgUpdateRingByAcp_PssInterval)(nil), + } +} + +type MsgUpdateRingByAcpResponse struct { +} + +func (m *MsgUpdateRingByAcpResponse) Reset() { *m = MsgUpdateRingByAcpResponse{} } +func (m *MsgUpdateRingByAcpResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateRingByAcpResponse) ProtoMessage() {} +func (*MsgUpdateRingByAcpResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7711ae63507074e0, []int{7} +} +func (m *MsgUpdateRingByAcpResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateRingByAcpResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateRingByAcpResponse.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 *MsgUpdateRingByAcpResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateRingByAcpResponse.Merge(m, src) +} +func (m *MsgUpdateRingByAcpResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateRingByAcpResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateRingByAcpResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateRingByAcpResponse proto.InternalMessageInfo + +type MsgFinalizeRingReshareByThresholdSignature struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + RingId string `protobuf:"bytes,2,opt,name=ring_id,json=ringId,proto3" json:"ring_id,omitempty"` + SignatureScheme string `protobuf:"bytes,3,opt,name=signature_scheme,json=signatureScheme,proto3" json:"signature_scheme,omitempty"` + Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (m *MsgFinalizeRingReshareByThresholdSignature) Reset() { + *m = MsgFinalizeRingReshareByThresholdSignature{} +} +func (m *MsgFinalizeRingReshareByThresholdSignature) String() string { + return proto.CompactTextString(m) +} +func (*MsgFinalizeRingReshareByThresholdSignature) ProtoMessage() {} +func (*MsgFinalizeRingReshareByThresholdSignature) Descriptor() ([]byte, []int) { + return fileDescriptor_7711ae63507074e0, []int{8} +} +func (m *MsgFinalizeRingReshareByThresholdSignature) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgFinalizeRingReshareByThresholdSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgFinalizeRingReshareByThresholdSignature.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 *MsgFinalizeRingReshareByThresholdSignature) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgFinalizeRingReshareByThresholdSignature.Merge(m, src) +} +func (m *MsgFinalizeRingReshareByThresholdSignature) XXX_Size() int { + return m.Size() +} +func (m *MsgFinalizeRingReshareByThresholdSignature) XXX_DiscardUnknown() { + xxx_messageInfo_MsgFinalizeRingReshareByThresholdSignature.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgFinalizeRingReshareByThresholdSignature proto.InternalMessageInfo + +func (m *MsgFinalizeRingReshareByThresholdSignature) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgFinalizeRingReshareByThresholdSignature) GetRingId() string { + if m != nil { + return m.RingId + } + return "" +} + +func (m *MsgFinalizeRingReshareByThresholdSignature) GetSignatureScheme() string { + if m != nil { + return m.SignatureScheme + } + return "" +} + +func (m *MsgFinalizeRingReshareByThresholdSignature) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +type MsgFinalizeRingReshareByThresholdSignatureResponse struct { +} + +func (m *MsgFinalizeRingReshareByThresholdSignatureResponse) Reset() { + *m = MsgFinalizeRingReshareByThresholdSignatureResponse{} +} +func (m *MsgFinalizeRingReshareByThresholdSignatureResponse) String() string { + return proto.CompactTextString(m) +} +func (*MsgFinalizeRingReshareByThresholdSignatureResponse) ProtoMessage() {} +func (*MsgFinalizeRingReshareByThresholdSignatureResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7711ae63507074e0, []int{9} +} +func (m *MsgFinalizeRingReshareByThresholdSignatureResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgFinalizeRingReshareByThresholdSignatureResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgFinalizeRingReshareByThresholdSignatureResponse.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 *MsgFinalizeRingReshareByThresholdSignatureResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgFinalizeRingReshareByThresholdSignatureResponse.Merge(m, src) +} +func (m *MsgFinalizeRingReshareByThresholdSignatureResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgFinalizeRingReshareByThresholdSignatureResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgFinalizeRingReshareByThresholdSignatureResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgFinalizeRingReshareByThresholdSignatureResponse proto.InternalMessageInfo + +type RingReshareFinalizeSignDoc struct { + Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"` + ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + RingId string `protobuf:"bytes,3,opt,name=ring_id,json=ringId,proto3" json:"ring_id,omitempty"` + RingPk string `protobuf:"bytes,4,opt,name=ring_pk,json=ringPk,proto3" json:"ring_pk,omitempty"` + CurrentRingSha256 []byte `protobuf:"bytes,5,opt,name=current_ring_sha256,json=currentRingSha256,proto3" json:"current_ring_sha256,omitempty"` + FinalizedRingSha256 []byte `protobuf:"bytes,6,opt,name=finalized_ring_sha256,json=finalizedRingSha256,proto3" json:"finalized_ring_sha256,omitempty"` + BlockNumberNonce uint64 `protobuf:"varint,7,opt,name=block_number_nonce,json=blockNumberNonce,proto3" json:"block_number_nonce,omitempty"` +} + +func (m *RingReshareFinalizeSignDoc) Reset() { *m = RingReshareFinalizeSignDoc{} } +func (m *RingReshareFinalizeSignDoc) String() string { return proto.CompactTextString(m) } +func (*RingReshareFinalizeSignDoc) ProtoMessage() {} +func (*RingReshareFinalizeSignDoc) Descriptor() ([]byte, []int) { + return fileDescriptor_7711ae63507074e0, []int{10} +} +func (m *RingReshareFinalizeSignDoc) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RingReshareFinalizeSignDoc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RingReshareFinalizeSignDoc.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 *RingReshareFinalizeSignDoc) XXX_Merge(src proto.Message) { + xxx_messageInfo_RingReshareFinalizeSignDoc.Merge(m, src) +} +func (m *RingReshareFinalizeSignDoc) XXX_Size() int { + return m.Size() +} +func (m *RingReshareFinalizeSignDoc) XXX_DiscardUnknown() { + xxx_messageInfo_RingReshareFinalizeSignDoc.DiscardUnknown(m) +} + +var xxx_messageInfo_RingReshareFinalizeSignDoc proto.InternalMessageInfo + +func (m *RingReshareFinalizeSignDoc) GetDomain() string { + if m != nil { + return m.Domain + } + return "" +} + +func (m *RingReshareFinalizeSignDoc) GetChainId() string { + if m != nil { + return m.ChainId + } + return "" +} + +func (m *RingReshareFinalizeSignDoc) GetRingId() string { + if m != nil { + return m.RingId + } + return "" +} + +func (m *RingReshareFinalizeSignDoc) GetRingPk() string { + if m != nil { + return m.RingPk + } + return "" +} + +func (m *RingReshareFinalizeSignDoc) GetCurrentRingSha256() []byte { + if m != nil { + return m.CurrentRingSha256 + } + return nil +} + +func (m *RingReshareFinalizeSignDoc) GetFinalizedRingSha256() []byte { + if m != nil { + return m.FinalizedRingSha256 + } + return nil +} + +func (m *RingReshareFinalizeSignDoc) GetBlockNumberNonce() uint64 { + if m != nil { + return m.BlockNumberNonce + } + return 0 +} + +type RingReshareSignState struct { + RingPk string `protobuf:"bytes,1,opt,name=ring_pk,json=ringPk,proto3" json:"ring_pk,omitempty"` + PeerNodeKeys []string `protobuf:"bytes,2,rep,name=peer_node_keys,json=peerNodeKeys,proto3" json:"peer_node_keys,omitempty"` + Threshold uint32 `protobuf:"varint,3,opt,name=threshold,proto3" json:"threshold,omitempty"` + NewPeerNodeKeys []string `protobuf:"bytes,4,rep,name=new_peer_node_keys,json=newPeerNodeKeys,proto3" json:"new_peer_node_keys,omitempty"` + // Types that are valid to be assigned to XNewThreshold: + // + // *RingReshareSignState_NewThreshold + XNewThreshold isRingReshareSignState_XNewThreshold `protobuf_oneof:"_new_threshold"` + // Types that are valid to be assigned to XPssInterval: + // + // *RingReshareSignState_PssInterval + XPssInterval isRingReshareSignState_XPssInterval `protobuf_oneof:"_pss_interval"` + BlockNumberNonce uint64 `protobuf:"varint,7,opt,name=block_number_nonce,json=blockNumberNonce,proto3" json:"block_number_nonce,omitempty"` + PolicyId string `protobuf:"bytes,8,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"` +} + +func (m *RingReshareSignState) Reset() { *m = RingReshareSignState{} } +func (m *RingReshareSignState) String() string { return proto.CompactTextString(m) } +func (*RingReshareSignState) ProtoMessage() {} +func (*RingReshareSignState) Descriptor() ([]byte, []int) { + return fileDescriptor_7711ae63507074e0, []int{11} +} +func (m *RingReshareSignState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RingReshareSignState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RingReshareSignState.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 *RingReshareSignState) XXX_Merge(src proto.Message) { + xxx_messageInfo_RingReshareSignState.Merge(m, src) +} +func (m *RingReshareSignState) XXX_Size() int { + return m.Size() +} +func (m *RingReshareSignState) XXX_DiscardUnknown() { + xxx_messageInfo_RingReshareSignState.DiscardUnknown(m) +} + +var xxx_messageInfo_RingReshareSignState proto.InternalMessageInfo + +type isRingReshareSignState_XNewThreshold interface { + isRingReshareSignState_XNewThreshold() + MarshalTo([]byte) (int, error) + Size() int +} +type isRingReshareSignState_XPssInterval interface { + isRingReshareSignState_XPssInterval() + MarshalTo([]byte) (int, error) + Size() int +} + +type RingReshareSignState_NewThreshold struct { + NewThreshold uint32 `protobuf:"varint,5,opt,name=new_threshold,json=newThreshold,proto3,oneof" json:"new_threshold,omitempty"` +} +type RingReshareSignState_PssInterval struct { + PssInterval uint64 `protobuf:"varint,6,opt,name=pss_interval,json=pssInterval,proto3,oneof" json:"pss_interval,omitempty"` +} + +func (*RingReshareSignState_NewThreshold) isRingReshareSignState_XNewThreshold() {} +func (*RingReshareSignState_PssInterval) isRingReshareSignState_XPssInterval() {} + +func (m *RingReshareSignState) GetXNewThreshold() isRingReshareSignState_XNewThreshold { + if m != nil { + return m.XNewThreshold + } + return nil +} +func (m *RingReshareSignState) GetXPssInterval() isRingReshareSignState_XPssInterval { + if m != nil { + return m.XPssInterval + } + return nil +} + +func (m *RingReshareSignState) GetRingPk() string { + if m != nil { + return m.RingPk + } + return "" +} + +func (m *RingReshareSignState) GetPeerNodeKeys() []string { + if m != nil { + return m.PeerNodeKeys + } + return nil +} + +func (m *RingReshareSignState) GetThreshold() uint32 { + if m != nil { + return m.Threshold + } + return 0 +} + +func (m *RingReshareSignState) GetNewPeerNodeKeys() []string { + if m != nil { + return m.NewPeerNodeKeys + } + return nil +} + +func (m *RingReshareSignState) GetNewThreshold() uint32 { + if x, ok := m.GetXNewThreshold().(*RingReshareSignState_NewThreshold); ok { + return x.NewThreshold + } + return 0 +} + +func (m *RingReshareSignState) GetPssInterval() uint64 { + if x, ok := m.GetXPssInterval().(*RingReshareSignState_PssInterval); ok { + return x.PssInterval + } + return 0 +} + +func (m *RingReshareSignState) GetBlockNumberNonce() uint64 { + if m != nil { + return m.BlockNumberNonce + } + return 0 +} + +func (m *RingReshareSignState) GetPolicyId() string { + if m != nil { + return m.PolicyId + } + return "" +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*RingReshareSignState) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*RingReshareSignState_NewThreshold)(nil), + (*RingReshareSignState_PssInterval)(nil), + } +} + +type MsgStoreDocument struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + RingId string `protobuf:"bytes,2,opt,name=ring_id,json=ringId,proto3" json:"ring_id,omitempty"` + Document string `protobuf:"bytes,3,opt,name=document,proto3" json:"document,omitempty"` + Proof string `protobuf:"bytes,4,opt,name=proof,proto3" json:"proof,omitempty"` + PolicyId string `protobuf:"bytes,5,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"` + Resource string `protobuf:"bytes,6,opt,name=resource,proto3" json:"resource,omitempty"` + Permission string `protobuf:"bytes,7,opt,name=permission,proto3" json:"permission,omitempty"` + // Types that are valid to be assigned to XTier: + // + // *MsgStoreDocument_Tier + XTier isMsgStoreDocument_XTier `protobuf_oneof:"_tier"` + // Types that are valid to be assigned to XTimestamp: + // + // *MsgStoreDocument_Timestamp + XTimestamp isMsgStoreDocument_XTimestamp `protobuf_oneof:"_timestamp"` +} + +func (m *MsgStoreDocument) Reset() { *m = MsgStoreDocument{} } +func (m *MsgStoreDocument) String() string { return proto.CompactTextString(m) } +func (*MsgStoreDocument) ProtoMessage() {} +func (*MsgStoreDocument) Descriptor() ([]byte, []int) { + return fileDescriptor_7711ae63507074e0, []int{12} +} +func (m *MsgStoreDocument) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgStoreDocument) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgStoreDocument.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 *MsgStoreDocument) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgStoreDocument.Merge(m, src) +} +func (m *MsgStoreDocument) XXX_Size() int { + return m.Size() +} +func (m *MsgStoreDocument) XXX_DiscardUnknown() { + xxx_messageInfo_MsgStoreDocument.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgStoreDocument proto.InternalMessageInfo + +type isMsgStoreDocument_XTier interface { + isMsgStoreDocument_XTier() + MarshalTo([]byte) (int, error) + Size() int +} +type isMsgStoreDocument_XTimestamp interface { + isMsgStoreDocument_XTimestamp() + MarshalTo([]byte) (int, error) + Size() int +} + +type MsgStoreDocument_Tier struct { + Tier string `protobuf:"bytes,8,opt,name=tier,proto3,oneof" json:"tier,omitempty"` +} +type MsgStoreDocument_Timestamp struct { + Timestamp uint64 `protobuf:"varint,9,opt,name=timestamp,proto3,oneof" json:"timestamp,omitempty"` +} + +func (*MsgStoreDocument_Tier) isMsgStoreDocument_XTier() {} +func (*MsgStoreDocument_Timestamp) isMsgStoreDocument_XTimestamp() {} + +func (m *MsgStoreDocument) GetXTier() isMsgStoreDocument_XTier { + if m != nil { + return m.XTier + } + return nil +} +func (m *MsgStoreDocument) GetXTimestamp() isMsgStoreDocument_XTimestamp { + if m != nil { + return m.XTimestamp + } + return nil +} + +func (m *MsgStoreDocument) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgStoreDocument) GetRingId() string { + if m != nil { + return m.RingId + } + return "" +} + +func (m *MsgStoreDocument) GetDocument() string { + if m != nil { + return m.Document + } + return "" +} + +func (m *MsgStoreDocument) GetProof() string { + if m != nil { + return m.Proof + } + return "" +} + +func (m *MsgStoreDocument) GetPolicyId() string { + if m != nil { + return m.PolicyId + } + return "" +} + +func (m *MsgStoreDocument) GetResource() string { + if m != nil { + return m.Resource + } + return "" +} + +func (m *MsgStoreDocument) GetPermission() string { + if m != nil { + return m.Permission + } + return "" +} + +func (m *MsgStoreDocument) GetTier() string { + if x, ok := m.GetXTier().(*MsgStoreDocument_Tier); ok { + return x.Tier + } + return "" +} + +func (m *MsgStoreDocument) GetTimestamp() uint64 { + if x, ok := m.GetXTimestamp().(*MsgStoreDocument_Timestamp); ok { + return x.Timestamp + } + return 0 +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*MsgStoreDocument) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*MsgStoreDocument_Tier)(nil), + (*MsgStoreDocument_Timestamp)(nil), + } +} + +type MsgStoreDocumentResponse struct { + DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"` +} + +func (m *MsgStoreDocumentResponse) Reset() { *m = MsgStoreDocumentResponse{} } +func (m *MsgStoreDocumentResponse) String() string { return proto.CompactTextString(m) } +func (*MsgStoreDocumentResponse) ProtoMessage() {} +func (*MsgStoreDocumentResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7711ae63507074e0, []int{13} +} +func (m *MsgStoreDocumentResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgStoreDocumentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgStoreDocumentResponse.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 *MsgStoreDocumentResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgStoreDocumentResponse.Merge(m, src) +} +func (m *MsgStoreDocumentResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgStoreDocumentResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgStoreDocumentResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgStoreDocumentResponse proto.InternalMessageInfo + +func (m *MsgStoreDocumentResponse) GetDocumentId() string { + if m != nil { + return m.DocumentId + } + return "" +} + +type MsgStoreKeyDerivation struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + RingId string `protobuf:"bytes,2,opt,name=ring_id,json=ringId,proto3" json:"ring_id,omitempty"` + Derivation string `protobuf:"bytes,3,opt,name=derivation,proto3" json:"derivation,omitempty"` + PolicyId string `protobuf:"bytes,4,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"` + Resource string `protobuf:"bytes,5,opt,name=resource,proto3" json:"resource,omitempty"` + Permission string `protobuf:"bytes,6,opt,name=permission,proto3" json:"permission,omitempty"` +} + +func (m *MsgStoreKeyDerivation) Reset() { *m = MsgStoreKeyDerivation{} } +func (m *MsgStoreKeyDerivation) String() string { return proto.CompactTextString(m) } +func (*MsgStoreKeyDerivation) ProtoMessage() {} +func (*MsgStoreKeyDerivation) Descriptor() ([]byte, []int) { + return fileDescriptor_7711ae63507074e0, []int{14} +} +func (m *MsgStoreKeyDerivation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgStoreKeyDerivation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgStoreKeyDerivation.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 *MsgStoreKeyDerivation) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgStoreKeyDerivation.Merge(m, src) +} +func (m *MsgStoreKeyDerivation) XXX_Size() int { + return m.Size() +} +func (m *MsgStoreKeyDerivation) XXX_DiscardUnknown() { + xxx_messageInfo_MsgStoreKeyDerivation.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgStoreKeyDerivation proto.InternalMessageInfo + +func (m *MsgStoreKeyDerivation) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgStoreKeyDerivation) GetRingId() string { + if m != nil { + return m.RingId + } + return "" +} + +func (m *MsgStoreKeyDerivation) GetDerivation() string { + if m != nil { + return m.Derivation + } + return "" +} + +func (m *MsgStoreKeyDerivation) GetPolicyId() string { + if m != nil { + return m.PolicyId + } + return "" +} + +func (m *MsgStoreKeyDerivation) GetResource() string { + if m != nil { + return m.Resource + } + return "" +} + +func (m *MsgStoreKeyDerivation) GetPermission() string { + if m != nil { + return m.Permission + } + return "" +} + +type MsgStoreKeyDerivationResponse struct { + KeyDerivationId string `protobuf:"bytes,1,opt,name=key_derivation_id,json=keyDerivationId,proto3" json:"key_derivation_id,omitempty"` +} + +func (m *MsgStoreKeyDerivationResponse) Reset() { *m = MsgStoreKeyDerivationResponse{} } +func (m *MsgStoreKeyDerivationResponse) String() string { return proto.CompactTextString(m) } +func (*MsgStoreKeyDerivationResponse) ProtoMessage() {} +func (*MsgStoreKeyDerivationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7711ae63507074e0, []int{15} +} +func (m *MsgStoreKeyDerivationResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgStoreKeyDerivationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgStoreKeyDerivationResponse.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 *MsgStoreKeyDerivationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgStoreKeyDerivationResponse.Merge(m, src) +} +func (m *MsgStoreKeyDerivationResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgStoreKeyDerivationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgStoreKeyDerivationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgStoreKeyDerivationResponse proto.InternalMessageInfo + +func (m *MsgStoreKeyDerivationResponse) GetKeyDerivationId() string { + if m != nil { + return m.KeyDerivationId + } + return "" +} + +type MsgCreateNodeInfo struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + PeerId string `protobuf:"bytes,2,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` + ControllerKey string `protobuf:"bytes,3,opt,name=controller_key,json=controllerKey,proto3" json:"controller_key,omitempty"` + WhitelistedPolicyIds []string `protobuf:"bytes,4,rep,name=whitelisted_policy_ids,json=whitelistedPolicyIds,proto3" json:"whitelisted_policy_ids,omitempty"` + WhitelistedRingIds []string `protobuf:"bytes,5,rep,name=whitelisted_ring_ids,json=whitelistedRingIds,proto3" json:"whitelisted_ring_ids,omitempty"` +} + +func (m *MsgCreateNodeInfo) Reset() { *m = MsgCreateNodeInfo{} } +func (m *MsgCreateNodeInfo) String() string { return proto.CompactTextString(m) } +func (*MsgCreateNodeInfo) ProtoMessage() {} +func (*MsgCreateNodeInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_7711ae63507074e0, []int{16} +} +func (m *MsgCreateNodeInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateNodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateNodeInfo.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 *MsgCreateNodeInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateNodeInfo.Merge(m, src) +} +func (m *MsgCreateNodeInfo) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateNodeInfo) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateNodeInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateNodeInfo proto.InternalMessageInfo + +func (m *MsgCreateNodeInfo) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgCreateNodeInfo) GetPeerId() string { + if m != nil { + return m.PeerId + } + return "" +} + +func (m *MsgCreateNodeInfo) GetControllerKey() string { + if m != nil { + return m.ControllerKey + } + return "" +} + +func (m *MsgCreateNodeInfo) GetWhitelistedPolicyIds() []string { + if m != nil { + return m.WhitelistedPolicyIds + } + return nil +} + +func (m *MsgCreateNodeInfo) GetWhitelistedRingIds() []string { + if m != nil { + return m.WhitelistedRingIds + } + return nil +} + +type MsgCreateNodeInfoResponse struct { +} + +func (m *MsgCreateNodeInfoResponse) Reset() { *m = MsgCreateNodeInfoResponse{} } +func (m *MsgCreateNodeInfoResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateNodeInfoResponse) ProtoMessage() {} +func (*MsgCreateNodeInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7711ae63507074e0, []int{17} +} +func (m *MsgCreateNodeInfoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateNodeInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateNodeInfoResponse.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 *MsgCreateNodeInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateNodeInfoResponse.Merge(m, src) +} +func (m *MsgCreateNodeInfoResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateNodeInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateNodeInfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateNodeInfoResponse proto.InternalMessageInfo + +// MsgUpdateNodeInfo replaces mutable fields on an existing NodeInfo record. +// The signer must be the current controller_key holder. +// +// IMPORTANT: whitelisted_policy_ids and whitelisted_ring_ids are REPLACED in +// full, not merged. To add a single entry you must re-send the complete desired +// list. Sending an empty repeated field clears the whitelist entirely. +type MsgUpdateNodeInfo struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + NodeKey string `protobuf:"bytes,2,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` + // Types that are valid to be assigned to XPeerId: + // + // *MsgUpdateNodeInfo_PeerId + XPeerId isMsgUpdateNodeInfo_XPeerId `protobuf_oneof:"_peer_id"` + // Replaces the full policy whitelist. Send the complete desired list on every + // update; an empty field clears all whitelisted policies. + WhitelistedPolicyIds []string `protobuf:"bytes,4,rep,name=whitelisted_policy_ids,json=whitelistedPolicyIds,proto3" json:"whitelisted_policy_ids,omitempty"` + // Replaces the full ring whitelist. Send the complete desired list on every + // update; an empty field clears all whitelisted rings. + WhitelistedRingIds []string `protobuf:"bytes,5,rep,name=whitelisted_ring_ids,json=whitelistedRingIds,proto3" json:"whitelisted_ring_ids,omitempty"` + // Types that are valid to be assigned to XControllerKey: + // + // *MsgUpdateNodeInfo_ControllerKey + XControllerKey isMsgUpdateNodeInfo_XControllerKey `protobuf_oneof:"_controller_key"` +} + +func (m *MsgUpdateNodeInfo) Reset() { *m = MsgUpdateNodeInfo{} } +func (m *MsgUpdateNodeInfo) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateNodeInfo) ProtoMessage() {} +func (*MsgUpdateNodeInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_7711ae63507074e0, []int{18} +} +func (m *MsgUpdateNodeInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateNodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateNodeInfo.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 *MsgUpdateNodeInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateNodeInfo.Merge(m, src) +} +func (m *MsgUpdateNodeInfo) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateNodeInfo) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateNodeInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateNodeInfo proto.InternalMessageInfo + +type isMsgUpdateNodeInfo_XPeerId interface { + isMsgUpdateNodeInfo_XPeerId() + MarshalTo([]byte) (int, error) + Size() int +} +type isMsgUpdateNodeInfo_XControllerKey interface { + isMsgUpdateNodeInfo_XControllerKey() + MarshalTo([]byte) (int, error) + Size() int +} + +type MsgUpdateNodeInfo_PeerId struct { + PeerId string `protobuf:"bytes,3,opt,name=peer_id,json=peerId,proto3,oneof" json:"peer_id,omitempty"` +} +type MsgUpdateNodeInfo_ControllerKey struct { + ControllerKey string `protobuf:"bytes,6,opt,name=controller_key,json=controllerKey,proto3,oneof" json:"controller_key,omitempty"` +} + +func (*MsgUpdateNodeInfo_PeerId) isMsgUpdateNodeInfo_XPeerId() {} +func (*MsgUpdateNodeInfo_ControllerKey) isMsgUpdateNodeInfo_XControllerKey() {} + +func (m *MsgUpdateNodeInfo) GetXPeerId() isMsgUpdateNodeInfo_XPeerId { + if m != nil { + return m.XPeerId + } + return nil +} +func (m *MsgUpdateNodeInfo) GetXControllerKey() isMsgUpdateNodeInfo_XControllerKey { + if m != nil { + return m.XControllerKey + } + return nil +} + +func (m *MsgUpdateNodeInfo) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgUpdateNodeInfo) GetNodeKey() string { + if m != nil { + return m.NodeKey + } + return "" +} + +func (m *MsgUpdateNodeInfo) GetPeerId() string { + if x, ok := m.GetXPeerId().(*MsgUpdateNodeInfo_PeerId); ok { + return x.PeerId + } + return "" +} + +func (m *MsgUpdateNodeInfo) GetWhitelistedPolicyIds() []string { + if m != nil { + return m.WhitelistedPolicyIds + } + return nil +} + +func (m *MsgUpdateNodeInfo) GetWhitelistedRingIds() []string { + if m != nil { + return m.WhitelistedRingIds + } + return nil +} + +func (m *MsgUpdateNodeInfo) GetControllerKey() string { + if x, ok := m.GetXControllerKey().(*MsgUpdateNodeInfo_ControllerKey); ok { + return x.ControllerKey + } + return "" +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*MsgUpdateNodeInfo) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*MsgUpdateNodeInfo_PeerId)(nil), + (*MsgUpdateNodeInfo_ControllerKey)(nil), + } +} + +type MsgUpdateNodeInfoResponse struct { +} + +func (m *MsgUpdateNodeInfoResponse) Reset() { *m = MsgUpdateNodeInfoResponse{} } +func (m *MsgUpdateNodeInfoResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateNodeInfoResponse) ProtoMessage() {} +func (*MsgUpdateNodeInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7711ae63507074e0, []int{19} +} +func (m *MsgUpdateNodeInfoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateNodeInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateNodeInfoResponse.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 *MsgUpdateNodeInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateNodeInfoResponse.Merge(m, src) +} +func (m *MsgUpdateNodeInfoResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateNodeInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateNodeInfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateNodeInfoResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgUpdateParams)(nil), "sourcehub.orbis.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "sourcehub.orbis.MsgUpdateParamsResponse") + proto.RegisterType((*MsgCreateRing)(nil), "sourcehub.orbis.MsgCreateRing") + proto.RegisterType((*MsgCreateRingResponse)(nil), "sourcehub.orbis.MsgCreateRingResponse") + proto.RegisterType((*MsgFinalizeRing)(nil), "sourcehub.orbis.MsgFinalizeRing") + proto.RegisterType((*MsgFinalizeRingResponse)(nil), "sourcehub.orbis.MsgFinalizeRingResponse") + proto.RegisterType((*MsgUpdateRingByAcp)(nil), "sourcehub.orbis.MsgUpdateRingByAcp") + proto.RegisterType((*MsgUpdateRingByAcpResponse)(nil), "sourcehub.orbis.MsgUpdateRingByAcpResponse") + proto.RegisterType((*MsgFinalizeRingReshareByThresholdSignature)(nil), "sourcehub.orbis.MsgFinalizeRingReshareByThresholdSignature") + proto.RegisterType((*MsgFinalizeRingReshareByThresholdSignatureResponse)(nil), "sourcehub.orbis.MsgFinalizeRingReshareByThresholdSignatureResponse") + proto.RegisterType((*RingReshareFinalizeSignDoc)(nil), "sourcehub.orbis.RingReshareFinalizeSignDoc") + proto.RegisterType((*RingReshareSignState)(nil), "sourcehub.orbis.RingReshareSignState") + proto.RegisterType((*MsgStoreDocument)(nil), "sourcehub.orbis.MsgStoreDocument") + proto.RegisterType((*MsgStoreDocumentResponse)(nil), "sourcehub.orbis.MsgStoreDocumentResponse") + proto.RegisterType((*MsgStoreKeyDerivation)(nil), "sourcehub.orbis.MsgStoreKeyDerivation") + proto.RegisterType((*MsgStoreKeyDerivationResponse)(nil), "sourcehub.orbis.MsgStoreKeyDerivationResponse") + proto.RegisterType((*MsgCreateNodeInfo)(nil), "sourcehub.orbis.MsgCreateNodeInfo") + proto.RegisterType((*MsgCreateNodeInfoResponse)(nil), "sourcehub.orbis.MsgCreateNodeInfoResponse") + proto.RegisterType((*MsgUpdateNodeInfo)(nil), "sourcehub.orbis.MsgUpdateNodeInfo") + proto.RegisterType((*MsgUpdateNodeInfoResponse)(nil), "sourcehub.orbis.MsgUpdateNodeInfoResponse") +} + +func init() { proto.RegisterFile("sourcehub/orbis/tx.proto", fileDescriptor_7711ae63507074e0) } + +var fileDescriptor_7711ae63507074e0 = []byte{ + // 1365 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xf7, 0x26, 0xb1, 0x63, 0xbf, 0xda, 0x71, 0x32, 0x4d, 0x1b, 0x67, 0x1b, 0xdc, 0xd4, 0x40, + 0x71, 0x5d, 0x88, 0x4b, 0x28, 0x3d, 0xb4, 0xa7, 0xba, 0x15, 0x8a, 0x89, 0x52, 0x45, 0x9b, 0x72, + 0xa9, 0x84, 0x96, 0xcd, 0xee, 0xd4, 0x5e, 0xd9, 0xde, 0x59, 0xed, 0xac, 0x9b, 0x9a, 0x13, 0xe2, + 0x54, 0x71, 0x42, 0xe2, 0x43, 0x80, 0xc4, 0xa5, 0x48, 0x88, 0x0b, 0x12, 0xe7, 0x1e, 0x0b, 0x27, + 0x4e, 0xa8, 0x6a, 0x0e, 0xf9, 0x06, 0x70, 0x45, 0x33, 0x3b, 0x3b, 0xfb, 0xc7, 0x4e, 0x62, 0x02, + 0xe2, 0x92, 0xf8, 0xfd, 0x9d, 0xf7, 0x7e, 0xef, 0xbd, 0x79, 0xb3, 0x50, 0xa1, 0x64, 0xe8, 0x99, + 0xb8, 0x3b, 0xdc, 0x6f, 0x12, 0x6f, 0xdf, 0xa6, 0x4d, 0xff, 0xe9, 0x86, 0xeb, 0x11, 0x9f, 0xa0, + 0xb2, 0x94, 0x6c, 0x70, 0x89, 0xba, 0x64, 0x0c, 0x6c, 0x87, 0x34, 0xf9, 0xdf, 0x40, 0x47, 0x5d, + 0x31, 0x09, 0x1d, 0x10, 0xda, 0x1c, 0xd0, 0x4e, 0xf3, 0xc9, 0xfb, 0xec, 0x9f, 0x10, 0xac, 0x06, + 0x02, 0x9d, 0x53, 0xcd, 0x80, 0x10, 0xa2, 0xe5, 0x0e, 0xe9, 0x90, 0x80, 0xcf, 0x7e, 0x09, 0xee, + 0x5a, 0x3a, 0x0e, 0xd7, 0xf0, 0x8c, 0x81, 0xb0, 0xa9, 0xfd, 0xac, 0x40, 0x79, 0x87, 0x76, 0x3e, + 0x71, 0x2d, 0xc3, 0xc7, 0xbb, 0x5c, 0x82, 0x6e, 0x41, 0xc1, 0x18, 0xfa, 0x5d, 0xe2, 0xd9, 0xfe, + 0xa8, 0xa2, 0xac, 0x2b, 0xf5, 0x42, 0xab, 0xf2, 0xdb, 0x8f, 0xef, 0x2d, 0x8b, 0xc3, 0xee, 0x5a, + 0x96, 0x87, 0x29, 0xdd, 0xf3, 0x3d, 0xdb, 0xe9, 0x68, 0x91, 0x2a, 0xba, 0x0d, 0xb9, 0xc0, 0x77, + 0x65, 0x66, 0x5d, 0xa9, 0x9f, 0xdb, 0x5c, 0xd9, 0x48, 0x25, 0xba, 0x11, 0x1c, 0xd0, 0x2a, 0xbc, + 0xf8, 0xe3, 0x72, 0xe6, 0xbb, 0xa3, 0xe7, 0x0d, 0x45, 0x13, 0x16, 0xb7, 0x6f, 0x7e, 0x79, 0xf4, + 0xbc, 0x11, 0xf9, 0xfa, 0xea, 0xe8, 0x79, 0xe3, 0x4a, 0x14, 0xf8, 0x53, 0x11, 0x7a, 0x2a, 0xd2, + 0xda, 0x2a, 0xac, 0xa4, 0x58, 0x1a, 0xa6, 0x2e, 0x71, 0x28, 0xae, 0xfd, 0xa9, 0x40, 0x69, 0x87, + 0x76, 0xee, 0x79, 0xd8, 0xf0, 0xb1, 0x66, 0x3b, 0x1d, 0x54, 0x81, 0x79, 0x93, 0x51, 0xc4, 0x0b, + 0x92, 0xd2, 0x42, 0x12, 0xbd, 0x05, 0x0b, 0x2e, 0xc6, 0x9e, 0xee, 0x10, 0x0b, 0xeb, 0x3d, 0x3c, + 0x62, 0x09, 0xcc, 0xd6, 0x0b, 0x5a, 0x91, 0x71, 0x1f, 0x10, 0x0b, 0x6f, 0xe3, 0x11, 0x45, 0x6b, + 0x50, 0xf0, 0xbb, 0x1e, 0xa6, 0x5d, 0xd2, 0xb7, 0x2a, 0xb3, 0xeb, 0x4a, 0xbd, 0xa4, 0x45, 0x0c, + 0x74, 0x15, 0x8a, 0x2e, 0xa5, 0xba, 0xed, 0xf8, 0xd8, 0x7b, 0x62, 0xf4, 0x2b, 0x73, 0xeb, 0x4a, + 0x7d, 0x6e, 0x2b, 0xa3, 0x9d, 0x73, 0x29, 0x6d, 0x0b, 0xe6, 0x33, 0x45, 0x41, 0x97, 0xa0, 0xe0, + 0x92, 0xbe, 0x6d, 0x8e, 0x74, 0xdb, 0xaa, 0x64, 0x79, 0x1c, 0xf9, 0x80, 0xd1, 0xb6, 0xd0, 0x2a, + 0x64, 0x1d, 0xe2, 0x98, 0xb8, 0x92, 0x63, 0x82, 0x2d, 0x45, 0x0b, 0xc8, 0x67, 0x8a, 0x72, 0xbb, + 0xc8, 0x00, 0x0a, 0x23, 0x6e, 0x95, 0xa1, 0xa4, 0xc7, 0x8f, 0x6b, 0xe5, 0x21, 0xa7, 0x73, 0xdd, + 0xda, 0x0d, 0xb8, 0x90, 0xc8, 0x3b, 0x44, 0x04, 0xad, 0xc0, 0x3c, 0xab, 0x18, 0x3b, 0x37, 0xc8, + 0x3f, 0xc7, 0xc8, 0xb6, 0x55, 0xeb, 0xf1, 0x16, 0xf8, 0xc8, 0x76, 0x8c, 0xbe, 0xfd, 0xf9, 0x69, + 0x58, 0xc5, 0xbc, 0xcc, 0xc4, 0xbd, 0x48, 0x81, 0xdb, 0xe3, 0xe0, 0x08, 0xc1, 0x6e, 0x2f, 0x19, + 0xb9, 0x28, 0x59, 0xfc, 0x30, 0x59, 0xb2, 0xbf, 0x14, 0x40, 0xb2, 0x9c, 0x4c, 0xd2, 0x1a, 0xdd, + 0x35, 0xdd, 0xb3, 0xc4, 0x72, 0x1d, 0x90, 0x83, 0x0f, 0xf4, 0x54, 0x51, 0x67, 0x79, 0x51, 0xcb, + 0x0e, 0x3e, 0xd8, 0x8d, 0xd7, 0xb5, 0x0e, 0x25, 0xa6, 0x1c, 0xd5, 0x96, 0x95, 0xae, 0xb4, 0x95, + 0xd1, 0x8a, 0x0e, 0x3e, 0x78, 0x18, 0x72, 0x59, 0xed, 0xd2, 0x35, 0xce, 0xf2, 0x1a, 0x2b, 0xe9, + 0x1a, 0xa7, 0x6a, 0xb5, 0x08, 0x0b, 0x7a, 0xe2, 0x80, 0xb1, 0xea, 0xd5, 0xd6, 0x40, 0x1d, 0x4f, + 0x5c, 0xe2, 0xf2, 0x93, 0x02, 0x8d, 0x71, 0xcc, 0xba, 0x86, 0x87, 0x5b, 0x23, 0x19, 0xdf, 0x9e, + 0xdd, 0x71, 0x0c, 0x7f, 0xe8, 0xe1, 0xb3, 0xe0, 0x75, 0x0d, 0x16, 0x69, 0x68, 0xaf, 0x53, 0xb3, + 0x8b, 0x07, 0x58, 0x14, 0xb1, 0x2c, 0xf9, 0x7b, 0x9c, 0xcd, 0xa6, 0x40, 0xb2, 0x38, 0x52, 0x45, + 0x2d, 0x62, 0xa4, 0x6a, 0x7d, 0x13, 0x36, 0xa7, 0x8f, 0x5b, 0xa6, 0xfb, 0xcd, 0x0c, 0xa8, 0x31, + 0xdd, 0xd0, 0x9c, 0x29, 0xde, 0x27, 0x26, 0xba, 0x08, 0x39, 0x8b, 0x0c, 0x0c, 0xdb, 0x09, 0xbb, + 0x38, 0xa0, 0xd0, 0x2a, 0xe4, 0xcd, 0xae, 0x61, 0x3b, 0x51, 0x76, 0xf3, 0x9c, 0x8e, 0xb5, 0xa6, + 0x6d, 0xc5, 0x5b, 0x33, 0xd9, 0xb3, 0x73, 0xf1, 0x9e, 0x45, 0x1b, 0x70, 0xde, 0x1c, 0x7a, 0x1e, + 0x76, 0x7c, 0x9d, 0x2b, 0xd0, 0xae, 0xb1, 0xf9, 0xe1, 0x2d, 0x5e, 0xf0, 0xa2, 0xb6, 0x24, 0x44, + 0x2c, 0xc8, 0x3d, 0x2e, 0x40, 0x9b, 0x70, 0xe1, 0xb1, 0x88, 0xd3, 0x4a, 0x58, 0xe4, 0xb8, 0xc5, + 0x79, 0x29, 0x8c, 0xd9, 0xbc, 0x0b, 0x68, 0xbf, 0x4f, 0xcc, 0x9e, 0xee, 0x0c, 0x07, 0xfb, 0xbc, + 0x51, 0xd9, 0xe4, 0xcf, 0xb3, 0x9e, 0xd2, 0x16, 0xb9, 0xe4, 0x01, 0x17, 0x3c, 0xe0, 0x63, 0xfd, + 0x6a, 0x06, 0x96, 0x63, 0xa8, 0x30, 0x34, 0xf6, 0x7c, 0xc3, 0xc7, 0xf1, 0x1c, 0x94, 0x44, 0x0e, + 0xff, 0xc5, 0xad, 0x36, 0x79, 0x90, 0xe6, 0xa6, 0x1c, 0xa4, 0xec, 0xb4, 0x83, 0x94, 0x9b, 0x3c, + 0x48, 0xff, 0x0c, 0xa2, 0xe4, 0xd5, 0x9a, 0x4f, 0x5e, 0xad, 0xd3, 0x4c, 0xe1, 0x0f, 0x33, 0xb0, + 0xb8, 0x43, 0x3b, 0x7b, 0x3e, 0xf1, 0xf0, 0x7d, 0x62, 0x0e, 0x07, 0xd8, 0xf1, 0xcf, 0x32, 0x4d, + 0x2a, 0xe4, 0x2d, 0x61, 0x2e, 0xfa, 0x4d, 0xd2, 0x68, 0x19, 0xb2, 0xae, 0x47, 0xc8, 0x63, 0xd1, + 0x6f, 0x01, 0x71, 0xf2, 0x52, 0x50, 0x21, 0xef, 0xe1, 0x60, 0x17, 0x06, 0x7b, 0x41, 0x93, 0x34, + 0xaa, 0x02, 0xb8, 0xd8, 0x1b, 0xd8, 0x94, 0xda, 0xc4, 0xe1, 0xc0, 0x14, 0xb4, 0x18, 0x07, 0xad, + 0xc0, 0x9c, 0x6f, 0x63, 0x2f, 0x40, 0x63, 0x2b, 0xa3, 0x71, 0x8a, 0x21, 0x7b, 0x05, 0x0a, 0xbe, + 0x3d, 0xc0, 0xd4, 0x37, 0x06, 0x6e, 0xa5, 0x20, 0xe0, 0x8f, 0x58, 0xe3, 0xb7, 0xd8, 0x3c, 0x64, + 0x75, 0x66, 0xdc, 0x2a, 0x02, 0xe8, 0x52, 0xaf, 0x76, 0x07, 0x2a, 0x69, 0xc8, 0xe4, 0xc2, 0xb9, + 0x0c, 0xe7, 0xc2, 0xbc, 0xa3, 0xa5, 0x03, 0x21, 0xab, 0x6d, 0xd5, 0x7e, 0x55, 0xf8, 0xae, 0xe2, + 0xd6, 0xdb, 0x78, 0x74, 0x1f, 0x7b, 0xf6, 0x13, 0xc3, 0x67, 0x71, 0x9f, 0x01, 0xf5, 0x2a, 0x80, + 0x25, 0x1d, 0x08, 0xdc, 0x63, 0x9c, 0x24, 0xc6, 0x73, 0x27, 0x60, 0x9c, 0x3d, 0x11, 0xe3, 0x5c, + 0x1a, 0xe3, 0xd4, 0x9d, 0xb7, 0x0d, 0x6f, 0x4c, 0x4c, 0x49, 0xa2, 0xd2, 0x80, 0xa5, 0x1e, 0x1e, + 0xe9, 0x51, 0x64, 0x11, 0x36, 0xe5, 0x5e, 0xdc, 0xa2, 0x6d, 0xd5, 0x0e, 0x15, 0x58, 0x92, 0xcb, + 0x9c, 0xcd, 0x59, 0xdb, 0x79, 0x4c, 0x4e, 0x06, 0x87, 0x8f, 0x6a, 0x04, 0x0e, 0x23, 0xdb, 0x16, + 0x7a, 0x1b, 0x16, 0x4c, 0xe2, 0xf8, 0x1e, 0xe9, 0xf7, 0xb1, 0xc7, 0x86, 0x58, 0x00, 0x54, 0x8a, + 0xb8, 0xdb, 0x78, 0x84, 0x6e, 0xc2, 0xc5, 0x83, 0xae, 0xed, 0xe3, 0xbe, 0x4d, 0x7d, 0x6c, 0xe9, + 0x12, 0xaf, 0x70, 0xe4, 0x97, 0x63, 0xd2, 0x5d, 0x81, 0x1d, 0x45, 0x37, 0x20, 0xce, 0xd7, 0x45, + 0x79, 0x68, 0x25, 0xcb, 0x6d, 0x50, 0x4c, 0xa6, 0xf1, 0x52, 0xd1, 0x14, 0x64, 0x97, 0x60, 0x75, + 0x2c, 0x49, 0xb9, 0x0d, 0xbe, 0x9d, 0xe1, 0x10, 0x04, 0xbb, 0x71, 0x0a, 0x08, 0x56, 0x21, 0x1f, + 0x5e, 0x54, 0xe1, 0x1a, 0x70, 0x82, 0x0b, 0x0a, 0xad, 0x45, 0xe8, 0xcc, 0x8a, 0x79, 0x10, 0xf8, + 0xb0, 0x89, 0xf8, 0x9f, 0x72, 0x47, 0x8d, 0xb1, 0x52, 0x84, 0x8f, 0xbd, 0x64, 0x31, 0xc6, 0x47, + 0x10, 0x20, 0xaf, 0x8b, 0x04, 0x5a, 0x4b, 0x50, 0xd6, 0x93, 0x6e, 0x04, 0x8c, 0x49, 0xa0, 0x42, + 0x18, 0x37, 0x7f, 0x99, 0x87, 0xd9, 0x1d, 0xda, 0x41, 0x8f, 0xa0, 0x98, 0x78, 0xeb, 0xaf, 0x8f, + 0xbd, 0xd1, 0x53, 0x0f, 0x6a, 0xb5, 0x7e, 0x9a, 0x86, 0xec, 0xec, 0x87, 0x00, 0xb1, 0xe7, 0x76, + 0x75, 0x92, 0x5d, 0x24, 0x57, 0xaf, 0x9e, 0x2c, 0x97, 0x5e, 0x1f, 0x41, 0x31, 0xf1, 0x34, 0x9d, + 0x18, 0x71, 0x5c, 0x63, 0x72, 0xc4, 0x93, 0x5e, 0x9c, 0xc8, 0x84, 0x72, 0xfa, 0xb5, 0xf9, 0xe6, + 0xf1, 0xe9, 0x4a, 0x25, 0xf5, 0xfa, 0x14, 0x4a, 0xf2, 0x90, 0xef, 0x15, 0x78, 0x67, 0xda, 0xb7, + 0xdb, 0x9d, 0x29, 0x42, 0x3f, 0xce, 0x58, 0xbd, 0xf7, 0x2f, 0x8c, 0x65, 0xb4, 0x9f, 0x42, 0x29, + 0xb9, 0x00, 0xaf, 0x4c, 0xf2, 0x9a, 0x50, 0x51, 0xaf, 0x9d, 0xaa, 0x22, 0xdd, 0xf7, 0x01, 0x4d, + 0xb8, 0xee, 0xaf, 0x1e, 0xeb, 0x20, 0xa1, 0xa7, 0x6e, 0x4c, 0xa7, 0x27, 0x4f, 0xfb, 0x0c, 0x16, + 0x52, 0x77, 0x67, 0xed, 0xf8, 0xae, 0x0b, 0x75, 0xd4, 0xc6, 0xe9, 0x3a, 0xf1, 0x13, 0x52, 0x57, + 0x53, 0xed, 0xf8, 0xde, 0x38, 0xf9, 0x84, 0xc9, 0x93, 0xab, 0x66, 0xbf, 0x60, 0x1f, 0xca, 0xad, + 0x8f, 0x5f, 0xbc, 0xae, 0x2a, 0x2f, 0x5f, 0x57, 0x95, 0x57, 0xaf, 0xab, 0xca, 0xd7, 0x87, 0xd5, + 0xcc, 0xcb, 0xc3, 0x6a, 0xe6, 0xf7, 0xc3, 0x6a, 0xe6, 0xd1, 0x8d, 0x8e, 0xed, 0x33, 0x47, 0x26, + 0x19, 0x34, 0x03, 0xb7, 0x0e, 0xf6, 0x0f, 0x88, 0xd7, 0x6b, 0x8e, 0x7f, 0x40, 0xfb, 0x23, 0x17, + 0xd3, 0xfd, 0x1c, 0xff, 0xf6, 0xff, 0xe0, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x17, 0xc8, 0xba, + 0xd6, 0xa3, 0x10, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // UpdateParams defines a governance operation for updating module parameters. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + CreateRing(ctx context.Context, in *MsgCreateRing, opts ...grpc.CallOption) (*MsgCreateRingResponse, error) + FinalizeRing(ctx context.Context, in *MsgFinalizeRing, opts ...grpc.CallOption) (*MsgFinalizeRingResponse, error) + UpdateRingByAcp(ctx context.Context, in *MsgUpdateRingByAcp, opts ...grpc.CallOption) (*MsgUpdateRingByAcpResponse, error) + FinalizeRingReshareByThresholdSignature(ctx context.Context, in *MsgFinalizeRingReshareByThresholdSignature, opts ...grpc.CallOption) (*MsgFinalizeRingReshareByThresholdSignatureResponse, error) + StoreDocument(ctx context.Context, in *MsgStoreDocument, opts ...grpc.CallOption) (*MsgStoreDocumentResponse, error) + StoreKeyDerivation(ctx context.Context, in *MsgStoreKeyDerivation, opts ...grpc.CallOption) (*MsgStoreKeyDerivationResponse, error) + CreateNodeInfo(ctx context.Context, in *MsgCreateNodeInfo, opts ...grpc.CallOption) (*MsgCreateNodeInfoResponse, error) + UpdateNodeInfo(ctx context.Context, in *MsgUpdateNodeInfo, opts ...grpc.CallOption) (*MsgUpdateNodeInfoResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/sourcehub.orbis.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CreateRing(ctx context.Context, in *MsgCreateRing, opts ...grpc.CallOption) (*MsgCreateRingResponse, error) { + out := new(MsgCreateRingResponse) + err := c.cc.Invoke(ctx, "/sourcehub.orbis.Msg/CreateRing", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) FinalizeRing(ctx context.Context, in *MsgFinalizeRing, opts ...grpc.CallOption) (*MsgFinalizeRingResponse, error) { + out := new(MsgFinalizeRingResponse) + err := c.cc.Invoke(ctx, "/sourcehub.orbis.Msg/FinalizeRing", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateRingByAcp(ctx context.Context, in *MsgUpdateRingByAcp, opts ...grpc.CallOption) (*MsgUpdateRingByAcpResponse, error) { + out := new(MsgUpdateRingByAcpResponse) + err := c.cc.Invoke(ctx, "/sourcehub.orbis.Msg/UpdateRingByAcp", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) FinalizeRingReshareByThresholdSignature(ctx context.Context, in *MsgFinalizeRingReshareByThresholdSignature, opts ...grpc.CallOption) (*MsgFinalizeRingReshareByThresholdSignatureResponse, error) { + out := new(MsgFinalizeRingReshareByThresholdSignatureResponse) + err := c.cc.Invoke(ctx, "/sourcehub.orbis.Msg/FinalizeRingReshareByThresholdSignature", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) StoreDocument(ctx context.Context, in *MsgStoreDocument, opts ...grpc.CallOption) (*MsgStoreDocumentResponse, error) { + out := new(MsgStoreDocumentResponse) + err := c.cc.Invoke(ctx, "/sourcehub.orbis.Msg/StoreDocument", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) StoreKeyDerivation(ctx context.Context, in *MsgStoreKeyDerivation, opts ...grpc.CallOption) (*MsgStoreKeyDerivationResponse, error) { + out := new(MsgStoreKeyDerivationResponse) + err := c.cc.Invoke(ctx, "/sourcehub.orbis.Msg/StoreKeyDerivation", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CreateNodeInfo(ctx context.Context, in *MsgCreateNodeInfo, opts ...grpc.CallOption) (*MsgCreateNodeInfoResponse, error) { + out := new(MsgCreateNodeInfoResponse) + err := c.cc.Invoke(ctx, "/sourcehub.orbis.Msg/CreateNodeInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateNodeInfo(ctx context.Context, in *MsgUpdateNodeInfo, opts ...grpc.CallOption) (*MsgUpdateNodeInfoResponse, error) { + out := new(MsgUpdateNodeInfoResponse) + err := c.cc.Invoke(ctx, "/sourcehub.orbis.Msg/UpdateNodeInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // UpdateParams defines a governance operation for updating module parameters. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + CreateRing(context.Context, *MsgCreateRing) (*MsgCreateRingResponse, error) + FinalizeRing(context.Context, *MsgFinalizeRing) (*MsgFinalizeRingResponse, error) + UpdateRingByAcp(context.Context, *MsgUpdateRingByAcp) (*MsgUpdateRingByAcpResponse, error) + FinalizeRingReshareByThresholdSignature(context.Context, *MsgFinalizeRingReshareByThresholdSignature) (*MsgFinalizeRingReshareByThresholdSignatureResponse, error) + StoreDocument(context.Context, *MsgStoreDocument) (*MsgStoreDocumentResponse, error) + StoreKeyDerivation(context.Context, *MsgStoreKeyDerivation) (*MsgStoreKeyDerivationResponse, error) + CreateNodeInfo(context.Context, *MsgCreateNodeInfo) (*MsgCreateNodeInfoResponse, error) + UpdateNodeInfo(context.Context, *MsgUpdateNodeInfo) (*MsgUpdateNodeInfoResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (*UnimplementedMsgServer) CreateRing(ctx context.Context, req *MsgCreateRing) (*MsgCreateRingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateRing not implemented") +} +func (*UnimplementedMsgServer) FinalizeRing(ctx context.Context, req *MsgFinalizeRing) (*MsgFinalizeRingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FinalizeRing not implemented") +} +func (*UnimplementedMsgServer) UpdateRingByAcp(ctx context.Context, req *MsgUpdateRingByAcp) (*MsgUpdateRingByAcpResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateRingByAcp not implemented") +} +func (*UnimplementedMsgServer) FinalizeRingReshareByThresholdSignature(ctx context.Context, req *MsgFinalizeRingReshareByThresholdSignature) (*MsgFinalizeRingReshareByThresholdSignatureResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FinalizeRingReshareByThresholdSignature not implemented") +} +func (*UnimplementedMsgServer) StoreDocument(ctx context.Context, req *MsgStoreDocument) (*MsgStoreDocumentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StoreDocument not implemented") +} +func (*UnimplementedMsgServer) StoreKeyDerivation(ctx context.Context, req *MsgStoreKeyDerivation) (*MsgStoreKeyDerivationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StoreKeyDerivation not implemented") +} +func (*UnimplementedMsgServer) CreateNodeInfo(ctx context.Context, req *MsgCreateNodeInfo) (*MsgCreateNodeInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateNodeInfo not implemented") +} +func (*UnimplementedMsgServer) UpdateNodeInfo(ctx context.Context, req *MsgUpdateNodeInfo) (*MsgUpdateNodeInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateNodeInfo not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sourcehub.orbis.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CreateRing_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateRing) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateRing(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sourcehub.orbis.Msg/CreateRing", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateRing(ctx, req.(*MsgCreateRing)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_FinalizeRing_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgFinalizeRing) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).FinalizeRing(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sourcehub.orbis.Msg/FinalizeRing", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).FinalizeRing(ctx, req.(*MsgFinalizeRing)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateRingByAcp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateRingByAcp) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateRingByAcp(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sourcehub.orbis.Msg/UpdateRingByAcp", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateRingByAcp(ctx, req.(*MsgUpdateRingByAcp)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_FinalizeRingReshareByThresholdSignature_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgFinalizeRingReshareByThresholdSignature) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).FinalizeRingReshareByThresholdSignature(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sourcehub.orbis.Msg/FinalizeRingReshareByThresholdSignature", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).FinalizeRingReshareByThresholdSignature(ctx, req.(*MsgFinalizeRingReshareByThresholdSignature)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_StoreDocument_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgStoreDocument) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).StoreDocument(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sourcehub.orbis.Msg/StoreDocument", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).StoreDocument(ctx, req.(*MsgStoreDocument)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_StoreKeyDerivation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgStoreKeyDerivation) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).StoreKeyDerivation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sourcehub.orbis.Msg/StoreKeyDerivation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).StoreKeyDerivation(ctx, req.(*MsgStoreKeyDerivation)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CreateNodeInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateNodeInfo) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateNodeInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sourcehub.orbis.Msg/CreateNodeInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateNodeInfo(ctx, req.(*MsgCreateNodeInfo)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateNodeInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateNodeInfo) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateNodeInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sourcehub.orbis.Msg/UpdateNodeInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateNodeInfo(ctx, req.(*MsgUpdateNodeInfo)) + } + return interceptor(ctx, in, info, handler) +} + +var Msg_serviceDesc = _Msg_serviceDesc +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "sourcehub.orbis.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "CreateRing", + Handler: _Msg_CreateRing_Handler, + }, + { + MethodName: "FinalizeRing", + Handler: _Msg_FinalizeRing_Handler, + }, + { + MethodName: "UpdateRingByAcp", + Handler: _Msg_UpdateRingByAcp_Handler, + }, + { + MethodName: "FinalizeRingReshareByThresholdSignature", + Handler: _Msg_FinalizeRingReshareByThresholdSignature_Handler, + }, + { + MethodName: "StoreDocument", + Handler: _Msg_StoreDocument_Handler, + }, + { + MethodName: "StoreKeyDerivation", + Handler: _Msg_StoreKeyDerivation_Handler, + }, + { + MethodName: "CreateNodeInfo", + Handler: _Msg_CreateNodeInfo_Handler, + }, + { + MethodName: "UpdateNodeInfo", + Handler: _Msg_UpdateNodeInfo_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "sourcehub/orbis/tx.proto", +} + +func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgCreateRing) 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 *MsgCreateRing) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateRing) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XNonce != nil { + { + size := m.XNonce.Size() + i -= size + if _, err := m.XNonce.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.PolicyId) > 0 { + i -= len(m.PolicyId) + copy(dAtA[i:], m.PolicyId) + i = encodeVarintTx(dAtA, i, uint64(len(m.PolicyId))) + i-- + dAtA[i] = 0x2a + } + if m.XPssInterval != nil { + { + size := m.XPssInterval.Size() + i -= size + if _, err := m.XPssInterval.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.Threshold != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Threshold)) + i-- + dAtA[i] = 0x18 + } + if len(m.PeerNodeKeys) > 0 { + for iNdEx := len(m.PeerNodeKeys) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.PeerNodeKeys[iNdEx]) + copy(dAtA[i:], m.PeerNodeKeys[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.PeerNodeKeys[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateRing_PssInterval) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateRing_PssInterval) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintTx(dAtA, i, uint64(m.PssInterval)) + i-- + dAtA[i] = 0x20 + return len(dAtA) - i, nil +} +func (m *MsgCreateRing_Nonce) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateRing_Nonce) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Nonce) + copy(dAtA[i:], m.Nonce) + i = encodeVarintTx(dAtA, i, uint64(len(m.Nonce))) + i-- + dAtA[i] = 0x32 + return len(dAtA) - i, nil +} +func (m *MsgCreateRingResponse) 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 *MsgCreateRingResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateRingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RingId) > 0 { + i -= len(m.RingId) + copy(dAtA[i:], m.RingId) + i = encodeVarintTx(dAtA, i, uint64(len(m.RingId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgFinalizeRing) 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 *MsgFinalizeRing) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgFinalizeRing) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RingPk) > 0 { + i -= len(m.RingPk) + copy(dAtA[i:], m.RingPk) + i = encodeVarintTx(dAtA, i, uint64(len(m.RingPk))) + i-- + dAtA[i] = 0x1a + } + if len(m.RingId) > 0 { + i -= len(m.RingId) + copy(dAtA[i:], m.RingId) + i = encodeVarintTx(dAtA, i, uint64(len(m.RingId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgFinalizeRingResponse) 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 *MsgFinalizeRingResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgFinalizeRingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateRingByAcp) 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 *MsgUpdateRingByAcp) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateRingByAcp) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XPssInterval != nil { + { + size := m.XPssInterval.Size() + i -= size + if _, err := m.XPssInterval.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.XNewThreshold != nil { + { + size := m.XNewThreshold.Size() + i -= size + if _, err := m.XNewThreshold.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.NewPeerNodeKeys) > 0 { + for iNdEx := len(m.NewPeerNodeKeys) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NewPeerNodeKeys[iNdEx]) + copy(dAtA[i:], m.NewPeerNodeKeys[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.NewPeerNodeKeys[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.RingId) > 0 { + i -= len(m.RingId) + copy(dAtA[i:], m.RingId) + i = encodeVarintTx(dAtA, i, uint64(len(m.RingId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateRingByAcp_NewThreshold) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateRingByAcp_NewThreshold) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintTx(dAtA, i, uint64(m.NewThreshold)) + i-- + dAtA[i] = 0x20 + return len(dAtA) - i, nil +} +func (m *MsgUpdateRingByAcp_PssInterval) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateRingByAcp_PssInterval) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintTx(dAtA, i, uint64(m.PssInterval)) + i-- + dAtA[i] = 0x28 + return len(dAtA) - i, nil +} +func (m *MsgUpdateRingByAcpResponse) 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 *MsgUpdateRingByAcpResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateRingByAcpResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgFinalizeRingReshareByThresholdSignature) 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 *MsgFinalizeRingReshareByThresholdSignature) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgFinalizeRingReshareByThresholdSignature) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x22 + } + if len(m.SignatureScheme) > 0 { + i -= len(m.SignatureScheme) + copy(dAtA[i:], m.SignatureScheme) + i = encodeVarintTx(dAtA, i, uint64(len(m.SignatureScheme))) + i-- + dAtA[i] = 0x1a + } + if len(m.RingId) > 0 { + i -= len(m.RingId) + copy(dAtA[i:], m.RingId) + i = encodeVarintTx(dAtA, i, uint64(len(m.RingId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgFinalizeRingReshareByThresholdSignatureResponse) 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 *MsgFinalizeRingReshareByThresholdSignatureResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgFinalizeRingReshareByThresholdSignatureResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *RingReshareFinalizeSignDoc) 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 *RingReshareFinalizeSignDoc) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RingReshareFinalizeSignDoc) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BlockNumberNonce != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.BlockNumberNonce)) + i-- + dAtA[i] = 0x38 + } + if len(m.FinalizedRingSha256) > 0 { + i -= len(m.FinalizedRingSha256) + copy(dAtA[i:], m.FinalizedRingSha256) + i = encodeVarintTx(dAtA, i, uint64(len(m.FinalizedRingSha256))) + i-- + dAtA[i] = 0x32 + } + if len(m.CurrentRingSha256) > 0 { + i -= len(m.CurrentRingSha256) + copy(dAtA[i:], m.CurrentRingSha256) + i = encodeVarintTx(dAtA, i, uint64(len(m.CurrentRingSha256))) + i-- + dAtA[i] = 0x2a + } + if len(m.RingPk) > 0 { + i -= len(m.RingPk) + copy(dAtA[i:], m.RingPk) + i = encodeVarintTx(dAtA, i, uint64(len(m.RingPk))) + i-- + dAtA[i] = 0x22 + } + if len(m.RingId) > 0 { + i -= len(m.RingId) + copy(dAtA[i:], m.RingId) + i = encodeVarintTx(dAtA, i, uint64(len(m.RingId))) + i-- + dAtA[i] = 0x1a + } + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Domain) > 0 { + i -= len(m.Domain) + copy(dAtA[i:], m.Domain) + i = encodeVarintTx(dAtA, i, uint64(len(m.Domain))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RingReshareSignState) 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 *RingReshareSignState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RingReshareSignState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PolicyId) > 0 { + i -= len(m.PolicyId) + copy(dAtA[i:], m.PolicyId) + i = encodeVarintTx(dAtA, i, uint64(len(m.PolicyId))) + i-- + dAtA[i] = 0x42 + } + if m.BlockNumberNonce != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.BlockNumberNonce)) + i-- + dAtA[i] = 0x38 + } + if m.XPssInterval != nil { + { + size := m.XPssInterval.Size() + i -= size + if _, err := m.XPssInterval.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.XNewThreshold != nil { + { + size := m.XNewThreshold.Size() + i -= size + if _, err := m.XNewThreshold.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.NewPeerNodeKeys) > 0 { + for iNdEx := len(m.NewPeerNodeKeys) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.NewPeerNodeKeys[iNdEx]) + copy(dAtA[i:], m.NewPeerNodeKeys[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.NewPeerNodeKeys[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if m.Threshold != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Threshold)) + i-- + dAtA[i] = 0x18 + } + if len(m.PeerNodeKeys) > 0 { + for iNdEx := len(m.PeerNodeKeys) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.PeerNodeKeys[iNdEx]) + copy(dAtA[i:], m.PeerNodeKeys[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.PeerNodeKeys[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.RingPk) > 0 { + i -= len(m.RingPk) + copy(dAtA[i:], m.RingPk) + i = encodeVarintTx(dAtA, i, uint64(len(m.RingPk))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RingReshareSignState_NewThreshold) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RingReshareSignState_NewThreshold) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintTx(dAtA, i, uint64(m.NewThreshold)) + i-- + dAtA[i] = 0x28 + return len(dAtA) - i, nil +} +func (m *RingReshareSignState_PssInterval) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RingReshareSignState_PssInterval) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintTx(dAtA, i, uint64(m.PssInterval)) + i-- + dAtA[i] = 0x30 + return len(dAtA) - i, nil +} +func (m *MsgStoreDocument) 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 *MsgStoreDocument) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgStoreDocument) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XTimestamp != nil { + { + size := m.XTimestamp.Size() + i -= size + if _, err := m.XTimestamp.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.XTier != nil { + { + size := m.XTier.Size() + i -= size + if _, err := m.XTier.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.Permission) > 0 { + i -= len(m.Permission) + copy(dAtA[i:], m.Permission) + i = encodeVarintTx(dAtA, i, uint64(len(m.Permission))) + i-- + dAtA[i] = 0x3a + } + if len(m.Resource) > 0 { + i -= len(m.Resource) + copy(dAtA[i:], m.Resource) + i = encodeVarintTx(dAtA, i, uint64(len(m.Resource))) + i-- + dAtA[i] = 0x32 + } + if len(m.PolicyId) > 0 { + i -= len(m.PolicyId) + copy(dAtA[i:], m.PolicyId) + i = encodeVarintTx(dAtA, i, uint64(len(m.PolicyId))) + i-- + dAtA[i] = 0x2a + } + if len(m.Proof) > 0 { + i -= len(m.Proof) + copy(dAtA[i:], m.Proof) + i = encodeVarintTx(dAtA, i, uint64(len(m.Proof))) + i-- + dAtA[i] = 0x22 + } + if len(m.Document) > 0 { + i -= len(m.Document) + copy(dAtA[i:], m.Document) + i = encodeVarintTx(dAtA, i, uint64(len(m.Document))) + i-- + dAtA[i] = 0x1a + } + if len(m.RingId) > 0 { + i -= len(m.RingId) + copy(dAtA[i:], m.RingId) + i = encodeVarintTx(dAtA, i, uint64(len(m.RingId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgStoreDocument_Tier) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgStoreDocument_Tier) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Tier) + copy(dAtA[i:], m.Tier) + i = encodeVarintTx(dAtA, i, uint64(len(m.Tier))) + i-- + dAtA[i] = 0x42 + return len(dAtA) - i, nil +} +func (m *MsgStoreDocument_Timestamp) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgStoreDocument_Timestamp) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintTx(dAtA, i, uint64(m.Timestamp)) + i-- + dAtA[i] = 0x48 + return len(dAtA) - i, nil +} +func (m *MsgStoreDocumentResponse) 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 *MsgStoreDocumentResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgStoreDocumentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DocumentId) > 0 { + i -= len(m.DocumentId) + copy(dAtA[i:], m.DocumentId) + i = encodeVarintTx(dAtA, i, uint64(len(m.DocumentId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgStoreKeyDerivation) 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 *MsgStoreKeyDerivation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgStoreKeyDerivation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Permission) > 0 { + i -= len(m.Permission) + copy(dAtA[i:], m.Permission) + i = encodeVarintTx(dAtA, i, uint64(len(m.Permission))) + i-- + dAtA[i] = 0x32 + } + if len(m.Resource) > 0 { + i -= len(m.Resource) + copy(dAtA[i:], m.Resource) + i = encodeVarintTx(dAtA, i, uint64(len(m.Resource))) + i-- + dAtA[i] = 0x2a + } + if len(m.PolicyId) > 0 { + i -= len(m.PolicyId) + copy(dAtA[i:], m.PolicyId) + i = encodeVarintTx(dAtA, i, uint64(len(m.PolicyId))) + i-- + dAtA[i] = 0x22 + } + if len(m.Derivation) > 0 { + i -= len(m.Derivation) + copy(dAtA[i:], m.Derivation) + i = encodeVarintTx(dAtA, i, uint64(len(m.Derivation))) + i-- + dAtA[i] = 0x1a + } + if len(m.RingId) > 0 { + i -= len(m.RingId) + copy(dAtA[i:], m.RingId) + i = encodeVarintTx(dAtA, i, uint64(len(m.RingId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgStoreKeyDerivationResponse) 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 *MsgStoreKeyDerivationResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgStoreKeyDerivationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.KeyDerivationId) > 0 { + i -= len(m.KeyDerivationId) + copy(dAtA[i:], m.KeyDerivationId) + i = encodeVarintTx(dAtA, i, uint64(len(m.KeyDerivationId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateNodeInfo) 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 *MsgCreateNodeInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateNodeInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.WhitelistedRingIds) > 0 { + for iNdEx := len(m.WhitelistedRingIds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.WhitelistedRingIds[iNdEx]) + copy(dAtA[i:], m.WhitelistedRingIds[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.WhitelistedRingIds[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if len(m.WhitelistedPolicyIds) > 0 { + for iNdEx := len(m.WhitelistedPolicyIds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.WhitelistedPolicyIds[iNdEx]) + copy(dAtA[i:], m.WhitelistedPolicyIds[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.WhitelistedPolicyIds[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.ControllerKey) > 0 { + i -= len(m.ControllerKey) + copy(dAtA[i:], m.ControllerKey) + i = encodeVarintTx(dAtA, i, uint64(len(m.ControllerKey))) + i-- + dAtA[i] = 0x1a + } + if len(m.PeerId) > 0 { + i -= len(m.PeerId) + copy(dAtA[i:], m.PeerId) + i = encodeVarintTx(dAtA, i, uint64(len(m.PeerId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateNodeInfoResponse) 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 *MsgCreateNodeInfoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateNodeInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateNodeInfo) 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 *MsgUpdateNodeInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateNodeInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XControllerKey != nil { + { + size := m.XControllerKey.Size() + i -= size + if _, err := m.XControllerKey.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.WhitelistedRingIds) > 0 { + for iNdEx := len(m.WhitelistedRingIds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.WhitelistedRingIds[iNdEx]) + copy(dAtA[i:], m.WhitelistedRingIds[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.WhitelistedRingIds[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if len(m.WhitelistedPolicyIds) > 0 { + for iNdEx := len(m.WhitelistedPolicyIds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.WhitelistedPolicyIds[iNdEx]) + copy(dAtA[i:], m.WhitelistedPolicyIds[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.WhitelistedPolicyIds[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if m.XPeerId != nil { + { + size := m.XPeerId.Size() + i -= size + if _, err := m.XPeerId.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if len(m.NodeKey) > 0 { + i -= len(m.NodeKey) + copy(dAtA[i:], m.NodeKey) + i = encodeVarintTx(dAtA, i, uint64(len(m.NodeKey))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateNodeInfo_PeerId) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateNodeInfo_PeerId) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.PeerId) + copy(dAtA[i:], m.PeerId) + i = encodeVarintTx(dAtA, i, uint64(len(m.PeerId))) + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil +} +func (m *MsgUpdateNodeInfo_ControllerKey) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateNodeInfo_ControllerKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.ControllerKey) + copy(dAtA[i:], m.ControllerKey) + i = encodeVarintTx(dAtA, i, uint64(len(m.ControllerKey))) + i-- + dAtA[i] = 0x32 + return len(dAtA) - i, nil +} +func (m *MsgUpdateNodeInfoResponse) 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 *MsgUpdateNodeInfoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateNodeInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgCreateRing) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.PeerNodeKeys) > 0 { + for _, s := range m.PeerNodeKeys { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + if m.Threshold != 0 { + n += 1 + sovTx(uint64(m.Threshold)) + } + if m.XPssInterval != nil { + n += m.XPssInterval.Size() + } + l = len(m.PolicyId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.XNonce != nil { + n += m.XNonce.Size() + } + return n +} + +func (m *MsgCreateRing_PssInterval) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovTx(uint64(m.PssInterval)) + return n +} +func (m *MsgCreateRing_Nonce) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Nonce) + n += 1 + l + sovTx(uint64(l)) + return n +} +func (m *MsgCreateRingResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RingId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgFinalizeRing) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.RingId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.RingPk) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgFinalizeRingResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateRingByAcp) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.RingId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.NewPeerNodeKeys) > 0 { + for _, s := range m.NewPeerNodeKeys { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + if m.XNewThreshold != nil { + n += m.XNewThreshold.Size() + } + if m.XPssInterval != nil { + n += m.XPssInterval.Size() + } + return n +} + +func (m *MsgUpdateRingByAcp_NewThreshold) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovTx(uint64(m.NewThreshold)) + return n +} +func (m *MsgUpdateRingByAcp_PssInterval) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovTx(uint64(m.PssInterval)) + return n +} +func (m *MsgUpdateRingByAcpResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgFinalizeRingReshareByThresholdSignature) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.RingId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.SignatureScheme) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgFinalizeRingReshareByThresholdSignatureResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *RingReshareFinalizeSignDoc) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.RingId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.RingPk) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.CurrentRingSha256) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.FinalizedRingSha256) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.BlockNumberNonce != 0 { + n += 1 + sovTx(uint64(m.BlockNumberNonce)) + } + return n +} + +func (m *RingReshareSignState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RingPk) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.PeerNodeKeys) > 0 { + for _, s := range m.PeerNodeKeys { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + if m.Threshold != 0 { + n += 1 + sovTx(uint64(m.Threshold)) + } + if len(m.NewPeerNodeKeys) > 0 { + for _, s := range m.NewPeerNodeKeys { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + if m.XNewThreshold != nil { + n += m.XNewThreshold.Size() + } + if m.XPssInterval != nil { + n += m.XPssInterval.Size() + } + if m.BlockNumberNonce != 0 { + n += 1 + sovTx(uint64(m.BlockNumberNonce)) + } + l = len(m.PolicyId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *RingReshareSignState_NewThreshold) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovTx(uint64(m.NewThreshold)) + return n +} +func (m *RingReshareSignState_PssInterval) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovTx(uint64(m.PssInterval)) + return n +} +func (m *MsgStoreDocument) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.RingId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Document) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Proof) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.PolicyId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Resource) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Permission) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.XTier != nil { + n += m.XTier.Size() + } + if m.XTimestamp != nil { + n += m.XTimestamp.Size() + } + return n +} + +func (m *MsgStoreDocument_Tier) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Tier) + n += 1 + l + sovTx(uint64(l)) + return n +} +func (m *MsgStoreDocument_Timestamp) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovTx(uint64(m.Timestamp)) + return n +} +func (m *MsgStoreDocumentResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DocumentId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgStoreKeyDerivation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.RingId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Derivation) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.PolicyId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Resource) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Permission) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgStoreKeyDerivationResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.KeyDerivationId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCreateNodeInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.PeerId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ControllerKey) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.WhitelistedPolicyIds) > 0 { + for _, s := range m.WhitelistedPolicyIds { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + if len(m.WhitelistedRingIds) > 0 { + for _, s := range m.WhitelistedRingIds { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgCreateNodeInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateNodeInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.NodeKey) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.XPeerId != nil { + n += m.XPeerId.Size() + } + if len(m.WhitelistedPolicyIds) > 0 { + for _, s := range m.WhitelistedPolicyIds { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + if len(m.WhitelistedRingIds) > 0 { + for _, s := range m.WhitelistedRingIds { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + if m.XControllerKey != nil { + n += m.XControllerKey.Size() + } + return n +} + +func (m *MsgUpdateNodeInfo_PeerId) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PeerId) + n += 1 + l + sovTx(uint64(l)) + return n +} +func (m *MsgUpdateNodeInfo_ControllerKey) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ControllerKey) + n += 1 + l + sovTx(uint64(l)) + return n +} +func (m *MsgUpdateNodeInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateRing) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateRing: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateRing: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PeerNodeKeys", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PeerNodeKeys = append(m.PeerNodeKeys, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Threshold", wireType) + } + m.Threshold = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Threshold |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PssInterval", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.XPssInterval = &MsgCreateRing_PssInterval{v} + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PolicyId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PolicyId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.XNonce = &MsgCreateRing_Nonce{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateRingResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateRingResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateRingResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RingId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RingId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgFinalizeRing) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgFinalizeRing: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgFinalizeRing: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RingId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RingId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RingPk", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RingPk = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgFinalizeRingResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgFinalizeRingResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgFinalizeRingResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateRingByAcp) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateRingByAcp: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateRingByAcp: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RingId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RingId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewPeerNodeKeys", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewPeerNodeKeys = append(m.NewPeerNodeKeys, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NewThreshold", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.XNewThreshold = &MsgUpdateRingByAcp_NewThreshold{v} + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PssInterval", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.XPssInterval = &MsgUpdateRingByAcp_PssInterval{v} + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateRingByAcpResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateRingByAcpResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateRingByAcpResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgFinalizeRingReshareByThresholdSignature) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgFinalizeRingReshareByThresholdSignature: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgFinalizeRingReshareByThresholdSignature: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RingId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RingId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SignatureScheme", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SignatureScheme = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgFinalizeRingReshareByThresholdSignatureResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgFinalizeRingReshareByThresholdSignatureResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgFinalizeRingReshareByThresholdSignatureResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RingReshareFinalizeSignDoc) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RingReshareFinalizeSignDoc: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RingReshareFinalizeSignDoc: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RingId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RingId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RingPk", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RingPk = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentRingSha256", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CurrentRingSha256 = append(m.CurrentRingSha256[:0], dAtA[iNdEx:postIndex]...) + if m.CurrentRingSha256 == nil { + m.CurrentRingSha256 = []byte{} + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FinalizedRingSha256", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FinalizedRingSha256 = append(m.FinalizedRingSha256[:0], dAtA[iNdEx:postIndex]...) + if m.FinalizedRingSha256 == nil { + m.FinalizedRingSha256 = []byte{} + } + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockNumberNonce", wireType) + } + m.BlockNumberNonce = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockNumberNonce |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RingReshareSignState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RingReshareSignState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RingReshareSignState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RingPk", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RingPk = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PeerNodeKeys", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PeerNodeKeys = append(m.PeerNodeKeys, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Threshold", wireType) + } + m.Threshold = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Threshold |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewPeerNodeKeys", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewPeerNodeKeys = append(m.NewPeerNodeKeys, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NewThreshold", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.XNewThreshold = &RingReshareSignState_NewThreshold{v} + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PssInterval", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.XPssInterval = &RingReshareSignState_PssInterval{v} + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockNumberNonce", wireType) + } + m.BlockNumberNonce = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockNumberNonce |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PolicyId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PolicyId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgStoreDocument) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgStoreDocument: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgStoreDocument: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RingId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RingId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Document", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Document = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proof = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PolicyId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PolicyId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resource = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Permission", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Permission = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tier", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.XTier = &MsgStoreDocument_Tier{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.XTimestamp = &MsgStoreDocument_Timestamp{v} + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgStoreDocumentResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgStoreDocumentResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgStoreDocumentResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DocumentId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DocumentId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgStoreKeyDerivation) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgStoreKeyDerivation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgStoreKeyDerivation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RingId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RingId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Derivation", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Derivation = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PolicyId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PolicyId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resource = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Permission", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Permission = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgStoreKeyDerivationResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgStoreKeyDerivationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgStoreKeyDerivationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KeyDerivationId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.KeyDerivationId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateNodeInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateNodeInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateNodeInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PeerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PeerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ControllerKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ControllerKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WhitelistedPolicyIds", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WhitelistedPolicyIds = append(m.WhitelistedPolicyIds, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WhitelistedRingIds", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WhitelistedRingIds = append(m.WhitelistedRingIds, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateNodeInfoResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateNodeInfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateNodeInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateNodeInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateNodeInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateNodeInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NodeKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PeerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.XPeerId = &MsgUpdateNodeInfo_PeerId{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WhitelistedPolicyIds", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WhitelistedPolicyIds = append(m.WhitelistedPolicyIds, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WhitelistedRingIds", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WhitelistedRingIds = append(m.WhitelistedRingIds, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ControllerKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.XControllerKey = &MsgUpdateNodeInfo_ControllerKey{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateNodeInfoResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateNodeInfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateNodeInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +)