From 5aaec1d690ec7a903457ac1e8307e1c208310558 Mon Sep 17 00:00:00 2001 From: 0xmuralik Date: Thu, 6 Oct 2022 16:19:03 +0530 Subject: [PATCH] attributes proto --- .../nameservice/v1beta1/attributes.proto | 29 + x/nameservice/types/attributes.pb.go | 1205 +++++++++++++++++ 2 files changed, 1234 insertions(+) create mode 100644 proto/vulcanize/nameservice/v1beta1/attributes.proto create mode 100644 x/nameservice/types/attributes.pb.go diff --git a/proto/vulcanize/nameservice/v1beta1/attributes.proto b/proto/vulcanize/nameservice/v1beta1/attributes.proto new file mode 100644 index 00000000..46a4e94b --- /dev/null +++ b/proto/vulcanize/nameservice/v1beta1/attributes.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package vulcanize.nameservice.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cerc-io/laconicd/x/nameservice/types"; + +message ServiceProviderRegistration { + string bond_id = 1 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""]; + string laconic_id = 2 [(gogoproto.moretags) = "json:\"laconicId\" yaml:\"laconicId\""]; + X500 x500 = 3 [(gogoproto.moretags) = "json:\"x500\" yaml:\"x500\""]; +} + +message X500 { + string common_name = 1 [(gogoproto.moretags) = "json:\"commonName\" yaml:\"commonName\""]; + string organization_unit = 2 [(gogoproto.moretags) = "json:\"organizationUnit\" yaml:\"organizationUnit\""]; + string organization_name = 3 [(gogoproto.moretags) = "json:\"organizationName\" yaml:\"organizationName\""]; + string locality_name = 4 [(gogoproto.moretags) = "json:\"localityName\" yaml:\"localityName\""]; + string state_name = 5 [(gogoproto.moretags) = "json:\"stateName\" yaml:\"stateName\""]; + string country = 6 [(gogoproto.moretags) = "json:\"country\" yaml:\"country\""]; +} + +message WebsiteRegistrationRecord { + string url = 1 [(gogoproto.moretags) = "json:\"url\" yaml:\"url\""]; + string repo_registration_record_cid = 2 + [(gogoproto.moretags) = "json:\"repoRegistrationRecordCID\" yaml:\"repoRegistrationRecordCID\""]; + string build_atrifact_cid = 3 [(gogoproto.moretags) = "json:\"buildArtifactCID\" yaml:\"buildArtifactCID\""]; + string TLS_cert_cid = 4 [(gogoproto.moretags) = "json:\"TLSCertCID\" yaml:\"TLSCertCID\""]; +} \ No newline at end of file diff --git a/x/nameservice/types/attributes.pb.go b/x/nameservice/types/attributes.pb.go new file mode 100644 index 00000000..ce31c8e3 --- /dev/null +++ b/x/nameservice/types/attributes.pb.go @@ -0,0 +1,1205 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: vulcanize/nameservice/v1beta1/attributes.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type ServiceProviderRegistration struct { + BondId string `protobuf:"bytes,1,opt,name=bond_id,json=bondId,proto3" json:"bond_id,omitempty" json:"bondId" yaml:"bondId"` + LaconicId string `protobuf:"bytes,2,opt,name=laconic_id,json=laconicId,proto3" json:"laconic_id,omitempty" json:"laconicId" yaml:"laconicId"` + X500 *X500 `protobuf:"bytes,3,opt,name=x500,proto3" json:"x500,omitempty" json:"x500" yaml:"x500"` +} + +func (m *ServiceProviderRegistration) Reset() { *m = ServiceProviderRegistration{} } +func (m *ServiceProviderRegistration) String() string { return proto.CompactTextString(m) } +func (*ServiceProviderRegistration) ProtoMessage() {} +func (*ServiceProviderRegistration) Descriptor() ([]byte, []int) { + return fileDescriptor_7f2d1895d048a86a, []int{0} +} +func (m *ServiceProviderRegistration) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ServiceProviderRegistration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ServiceProviderRegistration.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 *ServiceProviderRegistration) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceProviderRegistration.Merge(m, src) +} +func (m *ServiceProviderRegistration) XXX_Size() int { + return m.Size() +} +func (m *ServiceProviderRegistration) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceProviderRegistration.DiscardUnknown(m) +} + +var xxx_messageInfo_ServiceProviderRegistration proto.InternalMessageInfo + +func (m *ServiceProviderRegistration) GetBondId() string { + if m != nil { + return m.BondId + } + return "" +} + +func (m *ServiceProviderRegistration) GetLaconicId() string { + if m != nil { + return m.LaconicId + } + return "" +} + +func (m *ServiceProviderRegistration) GetX500() *X500 { + if m != nil { + return m.X500 + } + return nil +} + +type X500 struct { + CommonName string `protobuf:"bytes,1,opt,name=common_name,json=commonName,proto3" json:"common_name,omitempty" json:"commonName" yaml:"commonName"` + OrganizationUnit string `protobuf:"bytes,2,opt,name=organization_unit,json=organizationUnit,proto3" json:"organization_unit,omitempty" json:"organizationUnit" yaml:"organizationUnit"` + OrganizationName string `protobuf:"bytes,3,opt,name=organization_name,json=organizationName,proto3" json:"organization_name,omitempty" json:"organizationName" yaml:"organizationName"` + LocalityName string `protobuf:"bytes,4,opt,name=locality_name,json=localityName,proto3" json:"locality_name,omitempty" json:"localityName" yaml:"localityName"` + StateName string `protobuf:"bytes,5,opt,name=state_name,json=stateName,proto3" json:"state_name,omitempty" json:"stateName" yaml:"stateName"` + Country string `protobuf:"bytes,6,opt,name=country,proto3" json:"country,omitempty" json:"country" yaml:"country"` +} + +func (m *X500) Reset() { *m = X500{} } +func (m *X500) String() string { return proto.CompactTextString(m) } +func (*X500) ProtoMessage() {} +func (*X500) Descriptor() ([]byte, []int) { + return fileDescriptor_7f2d1895d048a86a, []int{1} +} +func (m *X500) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *X500) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_X500.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 *X500) XXX_Merge(src proto.Message) { + xxx_messageInfo_X500.Merge(m, src) +} +func (m *X500) XXX_Size() int { + return m.Size() +} +func (m *X500) XXX_DiscardUnknown() { + xxx_messageInfo_X500.DiscardUnknown(m) +} + +var xxx_messageInfo_X500 proto.InternalMessageInfo + +func (m *X500) GetCommonName() string { + if m != nil { + return m.CommonName + } + return "" +} + +func (m *X500) GetOrganizationUnit() string { + if m != nil { + return m.OrganizationUnit + } + return "" +} + +func (m *X500) GetOrganizationName() string { + if m != nil { + return m.OrganizationName + } + return "" +} + +func (m *X500) GetLocalityName() string { + if m != nil { + return m.LocalityName + } + return "" +} + +func (m *X500) GetStateName() string { + if m != nil { + return m.StateName + } + return "" +} + +func (m *X500) GetCountry() string { + if m != nil { + return m.Country + } + return "" +} + +type WebsiteRegistrationRecord struct { + Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty" json:"url" yaml:"url"` + RepoRegistrationRecordCid string `protobuf:"bytes,2,opt,name=repo_registration_record_cid,json=repoRegistrationRecordCid,proto3" json:"repo_registration_record_cid,omitempty" json:"repoRegistrationRecordCID" yaml:"repoRegistrationRecordCID"` + BuildAtrifactCid string `protobuf:"bytes,3,opt,name=build_atrifact_cid,json=buildAtrifactCid,proto3" json:"build_atrifact_cid,omitempty" json:"buildArtifactCID" yaml:"buildArtifactCID"` + TLSCertCid string `protobuf:"bytes,4,opt,name=TLS_cert_cid,json=TLSCertCid,proto3" json:"TLS_cert_cid,omitempty" json:"TLSCertCID" yaml:"TLSCertCID"` +} + +func (m *WebsiteRegistrationRecord) Reset() { *m = WebsiteRegistrationRecord{} } +func (m *WebsiteRegistrationRecord) String() string { return proto.CompactTextString(m) } +func (*WebsiteRegistrationRecord) ProtoMessage() {} +func (*WebsiteRegistrationRecord) Descriptor() ([]byte, []int) { + return fileDescriptor_7f2d1895d048a86a, []int{2} +} +func (m *WebsiteRegistrationRecord) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WebsiteRegistrationRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WebsiteRegistrationRecord.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 *WebsiteRegistrationRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_WebsiteRegistrationRecord.Merge(m, src) +} +func (m *WebsiteRegistrationRecord) XXX_Size() int { + return m.Size() +} +func (m *WebsiteRegistrationRecord) XXX_DiscardUnknown() { + xxx_messageInfo_WebsiteRegistrationRecord.DiscardUnknown(m) +} + +var xxx_messageInfo_WebsiteRegistrationRecord proto.InternalMessageInfo + +func (m *WebsiteRegistrationRecord) GetUrl() string { + if m != nil { + return m.Url + } + return "" +} + +func (m *WebsiteRegistrationRecord) GetRepoRegistrationRecordCid() string { + if m != nil { + return m.RepoRegistrationRecordCid + } + return "" +} + +func (m *WebsiteRegistrationRecord) GetBuildAtrifactCid() string { + if m != nil { + return m.BuildAtrifactCid + } + return "" +} + +func (m *WebsiteRegistrationRecord) GetTLSCertCid() string { + if m != nil { + return m.TLSCertCid + } + return "" +} + +func init() { + proto.RegisterType((*ServiceProviderRegistration)(nil), "vulcanize.nameservice.v1beta1.ServiceProviderRegistration") + proto.RegisterType((*X500)(nil), "vulcanize.nameservice.v1beta1.X500") + proto.RegisterType((*WebsiteRegistrationRecord)(nil), "vulcanize.nameservice.v1beta1.WebsiteRegistrationRecord") +} + +func init() { + proto.RegisterFile("vulcanize/nameservice/v1beta1/attributes.proto", fileDescriptor_7f2d1895d048a86a) +} + +var fileDescriptor_7f2d1895d048a86a = []byte{ + // 621 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x94, 0x5f, 0x4f, 0xd4, 0x4c, + 0x14, 0xc6, 0x29, 0xbb, 0x2f, 0x84, 0x81, 0x37, 0xc1, 0x46, 0x23, 0x88, 0xb4, 0xb0, 0xc4, 0x40, + 0x42, 0x6c, 0x17, 0x09, 0x89, 0xd1, 0x2b, 0xfe, 0x98, 0xb8, 0x09, 0x31, 0x64, 0xc0, 0x68, 0xbc, + 0xa9, 0xd3, 0xe9, 0xb8, 0x8e, 0x69, 0x3b, 0x64, 0x3a, 0xdd, 0xb0, 0x7e, 0x00, 0xaf, 0xfd, 0x58, + 0x5e, 0x72, 0xe9, 0x55, 0x63, 0xe0, 0xca, 0xdb, 0xfa, 0x01, 0x34, 0x33, 0xd3, 0xee, 0x0e, 0xdb, + 0xc0, 0xdd, 0x39, 0xcf, 0x79, 0xce, 0xef, 0xcc, 0xec, 0x9c, 0x2d, 0xf0, 0x06, 0x79, 0x8c, 0x51, + 0x4a, 0xbf, 0x12, 0x3f, 0x45, 0x09, 0xc9, 0x08, 0x1f, 0x50, 0x4c, 0xfc, 0xc1, 0x4e, 0x48, 0x04, + 0xda, 0xf1, 0x91, 0x10, 0x9c, 0x86, 0xb9, 0x20, 0x99, 0x77, 0xce, 0x99, 0x60, 0xf6, 0xea, 0xc8, + 0xef, 0x19, 0x7e, 0xaf, 0xf2, 0x3f, 0xba, 0xdf, 0x67, 0x7d, 0xa6, 0x9c, 0xbe, 0x8c, 0x74, 0x53, + 0xe7, 0x8f, 0x05, 0x56, 0x4e, 0xb5, 0xf3, 0x84, 0xb3, 0x01, 0x8d, 0x08, 0x87, 0xa4, 0x4f, 0x33, + 0xc1, 0x91, 0xa0, 0x2c, 0xb5, 0x9f, 0x83, 0xd9, 0x90, 0xa5, 0x51, 0x40, 0xa3, 0x25, 0x6b, 0xcd, + 0xda, 0x9a, 0x3b, 0x70, 0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 0xd6, 0x50, 0x20, 0xa8, 0x13, 0x1a, 0x1d, 0xf4, 0x7e, 0x5c, 0x39, 0xd6, 0xe5, 0x95, 0x63, 0xfd, + 0xba, 0x72, 0xac, 0xef, 0xd7, 0xce, 0xd4, 0xe5, 0xb5, 0x33, 0xf5, 0xf3, 0xda, 0x99, 0xfa, 0xe0, + 0xf7, 0xa9, 0xf8, 0x9c, 0x87, 0x1e, 0x66, 0x89, 0x8f, 0x09, 0xc7, 0x4f, 0x29, 0xf3, 0xab, 0xff, + 0x7e, 0xe4, 0x5f, 0xdc, 0xf8, 0xec, 0x89, 0xe1, 0x39, 0xc9, 0xc2, 0x19, 0xf5, 0xd5, 0xda, 0xfd, + 0x17, 0x00, 0x00, 0xff, 0xff, 0x11, 0xd8, 0xec, 0xb9, 0x1c, 0x05, 0x00, 0x00, +} + +func (m *ServiceProviderRegistration) 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 *ServiceProviderRegistration) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceProviderRegistration) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.X500 != nil { + { + size, err := m.X500.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAttributes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.LaconicId) > 0 { + i -= len(m.LaconicId) + copy(dAtA[i:], m.LaconicId) + i = encodeVarintAttributes(dAtA, i, uint64(len(m.LaconicId))) + i-- + dAtA[i] = 0x12 + } + if len(m.BondId) > 0 { + i -= len(m.BondId) + copy(dAtA[i:], m.BondId) + i = encodeVarintAttributes(dAtA, i, uint64(len(m.BondId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *X500) 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 *X500) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *X500) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Country) > 0 { + i -= len(m.Country) + copy(dAtA[i:], m.Country) + i = encodeVarintAttributes(dAtA, i, uint64(len(m.Country))) + i-- + dAtA[i] = 0x32 + } + if len(m.StateName) > 0 { + i -= len(m.StateName) + copy(dAtA[i:], m.StateName) + i = encodeVarintAttributes(dAtA, i, uint64(len(m.StateName))) + i-- + dAtA[i] = 0x2a + } + if len(m.LocalityName) > 0 { + i -= len(m.LocalityName) + copy(dAtA[i:], m.LocalityName) + i = encodeVarintAttributes(dAtA, i, uint64(len(m.LocalityName))) + i-- + dAtA[i] = 0x22 + } + if len(m.OrganizationName) > 0 { + i -= len(m.OrganizationName) + copy(dAtA[i:], m.OrganizationName) + i = encodeVarintAttributes(dAtA, i, uint64(len(m.OrganizationName))) + i-- + dAtA[i] = 0x1a + } + if len(m.OrganizationUnit) > 0 { + i -= len(m.OrganizationUnit) + copy(dAtA[i:], m.OrganizationUnit) + i = encodeVarintAttributes(dAtA, i, uint64(len(m.OrganizationUnit))) + i-- + dAtA[i] = 0x12 + } + if len(m.CommonName) > 0 { + i -= len(m.CommonName) + copy(dAtA[i:], m.CommonName) + i = encodeVarintAttributes(dAtA, i, uint64(len(m.CommonName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *WebsiteRegistrationRecord) 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 *WebsiteRegistrationRecord) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WebsiteRegistrationRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TLSCertCid) > 0 { + i -= len(m.TLSCertCid) + copy(dAtA[i:], m.TLSCertCid) + i = encodeVarintAttributes(dAtA, i, uint64(len(m.TLSCertCid))) + i-- + dAtA[i] = 0x22 + } + if len(m.BuildAtrifactCid) > 0 { + i -= len(m.BuildAtrifactCid) + copy(dAtA[i:], m.BuildAtrifactCid) + i = encodeVarintAttributes(dAtA, i, uint64(len(m.BuildAtrifactCid))) + i-- + dAtA[i] = 0x1a + } + if len(m.RepoRegistrationRecordCid) > 0 { + i -= len(m.RepoRegistrationRecordCid) + copy(dAtA[i:], m.RepoRegistrationRecordCid) + i = encodeVarintAttributes(dAtA, i, uint64(len(m.RepoRegistrationRecordCid))) + i-- + dAtA[i] = 0x12 + } + if len(m.Url) > 0 { + i -= len(m.Url) + copy(dAtA[i:], m.Url) + i = encodeVarintAttributes(dAtA, i, uint64(len(m.Url))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintAttributes(dAtA []byte, offset int, v uint64) int { + offset -= sovAttributes(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ServiceProviderRegistration) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.BondId) + if l > 0 { + n += 1 + l + sovAttributes(uint64(l)) + } + l = len(m.LaconicId) + if l > 0 { + n += 1 + l + sovAttributes(uint64(l)) + } + if m.X500 != nil { + l = m.X500.Size() + n += 1 + l + sovAttributes(uint64(l)) + } + return n +} + +func (m *X500) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.CommonName) + if l > 0 { + n += 1 + l + sovAttributes(uint64(l)) + } + l = len(m.OrganizationUnit) + if l > 0 { + n += 1 + l + sovAttributes(uint64(l)) + } + l = len(m.OrganizationName) + if l > 0 { + n += 1 + l + sovAttributes(uint64(l)) + } + l = len(m.LocalityName) + if l > 0 { + n += 1 + l + sovAttributes(uint64(l)) + } + l = len(m.StateName) + if l > 0 { + n += 1 + l + sovAttributes(uint64(l)) + } + l = len(m.Country) + if l > 0 { + n += 1 + l + sovAttributes(uint64(l)) + } + return n +} + +func (m *WebsiteRegistrationRecord) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Url) + if l > 0 { + n += 1 + l + sovAttributes(uint64(l)) + } + l = len(m.RepoRegistrationRecordCid) + if l > 0 { + n += 1 + l + sovAttributes(uint64(l)) + } + l = len(m.BuildAtrifactCid) + if l > 0 { + n += 1 + l + sovAttributes(uint64(l)) + } + l = len(m.TLSCertCid) + if l > 0 { + n += 1 + l + sovAttributes(uint64(l)) + } + return n +} + +func sovAttributes(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAttributes(x uint64) (n int) { + return sovAttributes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ServiceProviderRegistration) 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 ErrIntOverflowAttributes + } + 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: ServiceProviderRegistration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ServiceProviderRegistration: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BondId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttributes + } + 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 ErrInvalidLengthAttributes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAttributes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BondId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LaconicId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttributes + } + 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 ErrInvalidLengthAttributes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAttributes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LaconicId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field X500", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttributes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAttributes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAttributes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.X500 == nil { + m.X500 = &X500{} + } + if err := m.X500.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAttributes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAttributes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *X500) 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 ErrIntOverflowAttributes + } + 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: X500: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: X500: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CommonName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttributes + } + 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 ErrInvalidLengthAttributes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAttributes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CommonName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OrganizationUnit", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttributes + } + 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 ErrInvalidLengthAttributes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAttributes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OrganizationUnit = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OrganizationName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttributes + } + 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 ErrInvalidLengthAttributes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAttributes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OrganizationName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LocalityName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttributes + } + 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 ErrInvalidLengthAttributes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAttributes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LocalityName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StateName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttributes + } + 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 ErrInvalidLengthAttributes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAttributes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StateName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Country", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttributes + } + 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 ErrInvalidLengthAttributes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAttributes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Country = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAttributes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAttributes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WebsiteRegistrationRecord) 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 ErrIntOverflowAttributes + } + 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: WebsiteRegistrationRecord: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WebsiteRegistrationRecord: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttributes + } + 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 ErrInvalidLengthAttributes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAttributes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Url = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RepoRegistrationRecordCid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttributes + } + 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 ErrInvalidLengthAttributes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAttributes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RepoRegistrationRecordCid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BuildAtrifactCid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttributes + } + 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 ErrInvalidLengthAttributes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAttributes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BuildAtrifactCid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TLSCertCid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAttributes + } + 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 ErrInvalidLengthAttributes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAttributes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TLSCertCid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAttributes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAttributes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipAttributes(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, ErrIntOverflowAttributes + } + 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, ErrIntOverflowAttributes + } + 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, ErrIntOverflowAttributes + } + 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, ErrInvalidLengthAttributes + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAttributes + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAttributes + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAttributes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAttributes = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAttributes = fmt.Errorf("proto: unexpected end of group") +)