mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
(no commit message provided)
This commit is contained in:
committed by
Prad Nukala (aider)
parent
775150830f
commit
e127d70584
+376
-66
@@ -11,6 +11,7 @@ import (
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
io "io"
|
||||
reflect "reflect"
|
||||
sort "sort"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
@@ -1068,11 +1069,94 @@ func (x *fastReflection_DIDDocument) ProtoMethods() *protoiface.Methods {
|
||||
}
|
||||
}
|
||||
|
||||
var _ protoreflect.Map = (*_VerificationMethod_4_map)(nil)
|
||||
|
||||
type _VerificationMethod_4_map struct {
|
||||
m *map[string]string
|
||||
}
|
||||
|
||||
func (x *_VerificationMethod_4_map) Len() int {
|
||||
if x.m == nil {
|
||||
return 0
|
||||
}
|
||||
return len(*x.m)
|
||||
}
|
||||
|
||||
func (x *_VerificationMethod_4_map) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) {
|
||||
if x.m == nil {
|
||||
return
|
||||
}
|
||||
for k, v := range *x.m {
|
||||
mapKey := (protoreflect.MapKey)(protoreflect.ValueOfString(k))
|
||||
mapValue := protoreflect.ValueOfString(v)
|
||||
if !f(mapKey, mapValue) {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (x *_VerificationMethod_4_map) Has(key protoreflect.MapKey) bool {
|
||||
if x.m == nil {
|
||||
return false
|
||||
}
|
||||
keyUnwrapped := key.String()
|
||||
concreteValue := keyUnwrapped
|
||||
_, ok := (*x.m)[concreteValue]
|
||||
return ok
|
||||
}
|
||||
|
||||
func (x *_VerificationMethod_4_map) Clear(key protoreflect.MapKey) {
|
||||
if x.m == nil {
|
||||
return
|
||||
}
|
||||
keyUnwrapped := key.String()
|
||||
concreteKey := keyUnwrapped
|
||||
delete(*x.m, concreteKey)
|
||||
}
|
||||
|
||||
func (x *_VerificationMethod_4_map) Get(key protoreflect.MapKey) protoreflect.Value {
|
||||
if x.m == nil {
|
||||
return protoreflect.Value{}
|
||||
}
|
||||
keyUnwrapped := key.String()
|
||||
concreteKey := keyUnwrapped
|
||||
v, ok := (*x.m)[concreteKey]
|
||||
if !ok {
|
||||
return protoreflect.Value{}
|
||||
}
|
||||
return protoreflect.ValueOfString(v)
|
||||
}
|
||||
|
||||
func (x *_VerificationMethod_4_map) Set(key protoreflect.MapKey, value protoreflect.Value) {
|
||||
if !key.IsValid() || !value.IsValid() {
|
||||
panic("invalid key or value provided")
|
||||
}
|
||||
keyUnwrapped := key.String()
|
||||
concreteKey := keyUnwrapped
|
||||
valueUnwrapped := value.String()
|
||||
concreteValue := valueUnwrapped
|
||||
(*x.m)[concreteKey] = concreteValue
|
||||
}
|
||||
|
||||
func (x *_VerificationMethod_4_map) Mutable(key protoreflect.MapKey) protoreflect.Value {
|
||||
panic("should not call Mutable on protoreflect.Map whose value is not of type protoreflect.Message")
|
||||
}
|
||||
|
||||
func (x *_VerificationMethod_4_map) NewValue() protoreflect.Value {
|
||||
v := ""
|
||||
return protoreflect.ValueOfString(v)
|
||||
}
|
||||
|
||||
func (x *_VerificationMethod_4_map) IsValid() bool {
|
||||
return x.m != nil
|
||||
}
|
||||
|
||||
var (
|
||||
md_VerificationMethod protoreflect.MessageDescriptor
|
||||
fd_VerificationMethod_id protoreflect.FieldDescriptor
|
||||
fd_VerificationMethod_controller protoreflect.FieldDescriptor
|
||||
fd_VerificationMethod_public_key protoreflect.FieldDescriptor
|
||||
md_VerificationMethod protoreflect.MessageDescriptor
|
||||
fd_VerificationMethod_id protoreflect.FieldDescriptor
|
||||
fd_VerificationMethod_controller protoreflect.FieldDescriptor
|
||||
fd_VerificationMethod_public_key_multibase protoreflect.FieldDescriptor
|
||||
fd_VerificationMethod_public_key_jwks protoreflect.FieldDescriptor
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -1080,7 +1164,8 @@ func init() {
|
||||
md_VerificationMethod = File_did_v1_account_proto.Messages().ByName("VerificationMethod")
|
||||
fd_VerificationMethod_id = md_VerificationMethod.Fields().ByName("id")
|
||||
fd_VerificationMethod_controller = md_VerificationMethod.Fields().ByName("controller")
|
||||
fd_VerificationMethod_public_key = md_VerificationMethod.Fields().ByName("public_key")
|
||||
fd_VerificationMethod_public_key_multibase = md_VerificationMethod.Fields().ByName("public_key_multibase")
|
||||
fd_VerificationMethod_public_key_jwks = md_VerificationMethod.Fields().ByName("public_key_jwks")
|
||||
}
|
||||
|
||||
var _ protoreflect.Message = (*fastReflection_VerificationMethod)(nil)
|
||||
@@ -1160,9 +1245,15 @@ func (x *fastReflection_VerificationMethod) Range(f func(protoreflect.FieldDescr
|
||||
return
|
||||
}
|
||||
}
|
||||
if x.PublicKey != nil {
|
||||
value := protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect())
|
||||
if !f(fd_VerificationMethod_public_key, value) {
|
||||
if x.PublicKeyMultibase != "" {
|
||||
value := protoreflect.ValueOfString(x.PublicKeyMultibase)
|
||||
if !f(fd_VerificationMethod_public_key_multibase, value) {
|
||||
return
|
||||
}
|
||||
}
|
||||
if len(x.PublicKeyJwks) != 0 {
|
||||
value := protoreflect.ValueOfMap(&_VerificationMethod_4_map{m: &x.PublicKeyJwks})
|
||||
if !f(fd_VerificationMethod_public_key_jwks, value) {
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -1185,8 +1276,10 @@ func (x *fastReflection_VerificationMethod) Has(fd protoreflect.FieldDescriptor)
|
||||
return x.Id != ""
|
||||
case "did.v1.VerificationMethod.controller":
|
||||
return x.Controller != ""
|
||||
case "did.v1.VerificationMethod.public_key":
|
||||
return x.PublicKey != nil
|
||||
case "did.v1.VerificationMethod.public_key_multibase":
|
||||
return x.PublicKeyMultibase != ""
|
||||
case "did.v1.VerificationMethod.public_key_jwks":
|
||||
return len(x.PublicKeyJwks) != 0
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod"))
|
||||
@@ -1207,8 +1300,10 @@ func (x *fastReflection_VerificationMethod) Clear(fd protoreflect.FieldDescripto
|
||||
x.Id = ""
|
||||
case "did.v1.VerificationMethod.controller":
|
||||
x.Controller = ""
|
||||
case "did.v1.VerificationMethod.public_key":
|
||||
x.PublicKey = nil
|
||||
case "did.v1.VerificationMethod.public_key_multibase":
|
||||
x.PublicKeyMultibase = ""
|
||||
case "did.v1.VerificationMethod.public_key_jwks":
|
||||
x.PublicKeyJwks = nil
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod"))
|
||||
@@ -1231,9 +1326,15 @@ func (x *fastReflection_VerificationMethod) Get(descriptor protoreflect.FieldDes
|
||||
case "did.v1.VerificationMethod.controller":
|
||||
value := x.Controller
|
||||
return protoreflect.ValueOfString(value)
|
||||
case "did.v1.VerificationMethod.public_key":
|
||||
value := x.PublicKey
|
||||
return protoreflect.ValueOfMessage(value.ProtoReflect())
|
||||
case "did.v1.VerificationMethod.public_key_multibase":
|
||||
value := x.PublicKeyMultibase
|
||||
return protoreflect.ValueOfString(value)
|
||||
case "did.v1.VerificationMethod.public_key_jwks":
|
||||
if len(x.PublicKeyJwks) == 0 {
|
||||
return protoreflect.ValueOfMap(&_VerificationMethod_4_map{})
|
||||
}
|
||||
mapValue := &_VerificationMethod_4_map{m: &x.PublicKeyJwks}
|
||||
return protoreflect.ValueOfMap(mapValue)
|
||||
default:
|
||||
if descriptor.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod"))
|
||||
@@ -1258,8 +1359,12 @@ func (x *fastReflection_VerificationMethod) Set(fd protoreflect.FieldDescriptor,
|
||||
x.Id = value.Interface().(string)
|
||||
case "did.v1.VerificationMethod.controller":
|
||||
x.Controller = value.Interface().(string)
|
||||
case "did.v1.VerificationMethod.public_key":
|
||||
x.PublicKey = value.Message().Interface().(*PublicKey)
|
||||
case "did.v1.VerificationMethod.public_key_multibase":
|
||||
x.PublicKeyMultibase = value.Interface().(string)
|
||||
case "did.v1.VerificationMethod.public_key_jwks":
|
||||
mv := value.Map()
|
||||
cmv := mv.(*_VerificationMethod_4_map)
|
||||
x.PublicKeyJwks = *cmv.m
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod"))
|
||||
@@ -1280,15 +1385,18 @@ func (x *fastReflection_VerificationMethod) Set(fd protoreflect.FieldDescriptor,
|
||||
// Mutable is a mutating operation and unsafe for concurrent use.
|
||||
func (x *fastReflection_VerificationMethod) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch fd.FullName() {
|
||||
case "did.v1.VerificationMethod.public_key":
|
||||
if x.PublicKey == nil {
|
||||
x.PublicKey = new(PublicKey)
|
||||
case "did.v1.VerificationMethod.public_key_jwks":
|
||||
if x.PublicKeyJwks == nil {
|
||||
x.PublicKeyJwks = make(map[string]string)
|
||||
}
|
||||
return protoreflect.ValueOfMessage(x.PublicKey.ProtoReflect())
|
||||
value := &_VerificationMethod_4_map{m: &x.PublicKeyJwks}
|
||||
return protoreflect.ValueOfMap(value)
|
||||
case "did.v1.VerificationMethod.id":
|
||||
panic(fmt.Errorf("field id of message did.v1.VerificationMethod is not mutable"))
|
||||
case "did.v1.VerificationMethod.controller":
|
||||
panic(fmt.Errorf("field controller of message did.v1.VerificationMethod is not mutable"))
|
||||
case "did.v1.VerificationMethod.public_key_multibase":
|
||||
panic(fmt.Errorf("field public_key_multibase of message did.v1.VerificationMethod is not mutable"))
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod"))
|
||||
@@ -1306,9 +1414,11 @@ func (x *fastReflection_VerificationMethod) NewField(fd protoreflect.FieldDescri
|
||||
return protoreflect.ValueOfString("")
|
||||
case "did.v1.VerificationMethod.controller":
|
||||
return protoreflect.ValueOfString("")
|
||||
case "did.v1.VerificationMethod.public_key":
|
||||
m := new(PublicKey)
|
||||
return protoreflect.ValueOfMessage(m.ProtoReflect())
|
||||
case "did.v1.VerificationMethod.public_key_multibase":
|
||||
return protoreflect.ValueOfString("")
|
||||
case "did.v1.VerificationMethod.public_key_jwks":
|
||||
m := make(map[string]string)
|
||||
return protoreflect.ValueOfMap(&_VerificationMethod_4_map{m: &m})
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.VerificationMethod"))
|
||||
@@ -1386,10 +1496,31 @@ func (x *fastReflection_VerificationMethod) ProtoMethods() *protoiface.Methods {
|
||||
if l > 0 {
|
||||
n += 1 + l + runtime.Sov(uint64(l))
|
||||
}
|
||||
if x.PublicKey != nil {
|
||||
l = options.Size(x.PublicKey)
|
||||
l = len(x.PublicKeyMultibase)
|
||||
if l > 0 {
|
||||
n += 1 + l + runtime.Sov(uint64(l))
|
||||
}
|
||||
if len(x.PublicKeyJwks) > 0 {
|
||||
SiZeMaP := func(k string, v string) {
|
||||
mapEntrySize := 1 + len(k) + runtime.Sov(uint64(len(k))) + 1 + len(v) + runtime.Sov(uint64(len(v)))
|
||||
n += mapEntrySize + 1 + runtime.Sov(uint64(mapEntrySize))
|
||||
}
|
||||
if options.Deterministic {
|
||||
sortme := make([]string, 0, len(x.PublicKeyJwks))
|
||||
for k := range x.PublicKeyJwks {
|
||||
sortme = append(sortme, k)
|
||||
}
|
||||
sort.Strings(sortme)
|
||||
for _, k := range sortme {
|
||||
v := x.PublicKeyJwks[k]
|
||||
SiZeMaP(k, v)
|
||||
}
|
||||
} else {
|
||||
for k, v := range x.PublicKeyJwks {
|
||||
SiZeMaP(k, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
if x.unknownFields != nil {
|
||||
n += len(x.unknownFields)
|
||||
}
|
||||
@@ -1419,17 +1550,53 @@ func (x *fastReflection_VerificationMethod) ProtoMethods() *protoiface.Methods {
|
||||
i -= len(x.unknownFields)
|
||||
copy(dAtA[i:], x.unknownFields)
|
||||
}
|
||||
if x.PublicKey != nil {
|
||||
encoded, err := options.Marshal(x.PublicKey)
|
||||
if err != nil {
|
||||
return protoiface.MarshalOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
Buf: input.Buf,
|
||||
}, err
|
||||
if len(x.PublicKeyJwks) > 0 {
|
||||
MaRsHaLmAp := func(k string, v string) (protoiface.MarshalOutput, error) {
|
||||
baseI := i
|
||||
i -= len(v)
|
||||
copy(dAtA[i:], v)
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(v)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
i -= len(k)
|
||||
copy(dAtA[i:], k)
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(k)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(baseI-i))
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
return protoiface.MarshalOutput{}, nil
|
||||
}
|
||||
i -= len(encoded)
|
||||
copy(dAtA[i:], encoded)
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded)))
|
||||
if options.Deterministic {
|
||||
keysForPublicKeyJwks := make([]string, 0, len(x.PublicKeyJwks))
|
||||
for k := range x.PublicKeyJwks {
|
||||
keysForPublicKeyJwks = append(keysForPublicKeyJwks, string(k))
|
||||
}
|
||||
sort.Slice(keysForPublicKeyJwks, func(i, j int) bool {
|
||||
return keysForPublicKeyJwks[i] < keysForPublicKeyJwks[j]
|
||||
})
|
||||
for iNdEx := len(keysForPublicKeyJwks) - 1; iNdEx >= 0; iNdEx-- {
|
||||
v := x.PublicKeyJwks[string(keysForPublicKeyJwks[iNdEx])]
|
||||
out, err := MaRsHaLmAp(keysForPublicKeyJwks[iNdEx], v)
|
||||
if err != nil {
|
||||
return out, err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for k := range x.PublicKeyJwks {
|
||||
v := x.PublicKeyJwks[k]
|
||||
out, err := MaRsHaLmAp(k, v)
|
||||
if err != nil {
|
||||
return out, err
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if len(x.PublicKeyMultibase) > 0 {
|
||||
i -= len(x.PublicKeyMultibase)
|
||||
copy(dAtA[i:], x.PublicKeyMultibase)
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.PublicKeyMultibase)))
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
@@ -1562,7 +1729,39 @@ func (x *fastReflection_VerificationMethod) ProtoMethods() *protoiface.Methods {
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 2 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType)
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field PublicKeyMultibase", 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.PublicKeyMultibase = 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 PublicKeyJwks", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
@@ -1589,12 +1788,103 @@ func (x *fastReflection_VerificationMethod) ProtoMethods() *protoiface.Methods {
|
||||
if postIndex > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
if x.PublicKey == nil {
|
||||
x.PublicKey = &PublicKey{}
|
||||
if x.PublicKeyJwks == nil {
|
||||
x.PublicKeyJwks = make(map[string]string)
|
||||
}
|
||||
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.PublicKey); err != nil {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
||||
var mapkey string
|
||||
var mapvalue string
|
||||
for iNdEx < postIndex {
|
||||
entryPreIndex := 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)
|
||||
if fieldNum == 1 {
|
||||
var stringLenmapkey 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++
|
||||
stringLenmapkey |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLenmapkey := int(stringLenmapkey)
|
||||
if intStringLenmapkey < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
postStringIndexmapkey := iNdEx + intStringLenmapkey
|
||||
if postStringIndexmapkey < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
if postStringIndexmapkey > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
mapkey = string(dAtA[iNdEx:postStringIndexmapkey])
|
||||
iNdEx = postStringIndexmapkey
|
||||
} else if fieldNum == 2 {
|
||||
var stringLenmapvalue 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++
|
||||
stringLenmapvalue |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLenmapvalue := int(stringLenmapvalue)
|
||||
if intStringLenmapvalue < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
postStringIndexmapvalue := iNdEx + intStringLenmapvalue
|
||||
if postStringIndexmapvalue < 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
|
||||
}
|
||||
if postStringIndexmapvalue > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
|
||||
iNdEx = postStringIndexmapvalue
|
||||
} else {
|
||||
iNdEx = entryPreIndex
|
||||
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) > postIndex {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
x.PublicKeyJwks[mapkey] = mapvalue
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
@@ -1729,9 +2019,12 @@ type VerificationMethod struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"`
|
||||
PublicKey *PublicKey `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"`
|
||||
// The delegation proof or verification method
|
||||
PublicKeyMultibase string `protobuf:"bytes,3,opt,name=public_key_multibase,json=publicKeyMultibase,proto3" json:"public_key_multibase,omitempty"`
|
||||
// Public Key JWKS is a map of the associated public keys
|
||||
PublicKeyJwks map[string]string `protobuf:"bytes,4,rep,name=public_key_jwks,json=publicKeyJwks,proto3" json:"public_key_jwks,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||
}
|
||||
|
||||
func (x *VerificationMethod) Reset() {
|
||||
@@ -1768,9 +2061,16 @@ func (x *VerificationMethod) GetController() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *VerificationMethod) GetPublicKey() *PublicKey {
|
||||
func (x *VerificationMethod) GetPublicKeyMultibase() string {
|
||||
if x != nil {
|
||||
return x.PublicKey
|
||||
return x.PublicKeyMultibase
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *VerificationMethod) GetPublicKeyJwks() map[string]string {
|
||||
if x != nil {
|
||||
return x.PublicKeyJwks
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -1803,22 +2103,32 @@ var file_did_v1_account_proto_rawDesc = []byte{
|
||||
0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x6e, 0x76, 0x6f, 0x63,
|
||||
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x63, 0x61, 0x70,
|
||||
0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x22, 0x76, 0x0a, 0x12, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72,
|
||||
0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e,
|
||||
0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69,
|
||||
0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, 0x69,
|
||||
0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x52, 0x09,
|
||||
0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x42, 0x7c, 0x0a, 0x0a, 0x63, 0x6f, 0x6d,
|
||||
0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74,
|
||||
0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
|
||||
0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, 0x2f,
|
||||
0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31,
|
||||
0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca,
|
||||
0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56,
|
||||
0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07,
|
||||
0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x6e, 0x22, 0x8f, 0x02, 0x0a, 0x12, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74,
|
||||
0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f,
|
||||
0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x14, 0x70, 0x75, 0x62, 0x6c,
|
||||
0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x62, 0x61, 0x73, 0x65,
|
||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65,
|
||||
0x79, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x62, 0x61, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0f, 0x70, 0x75,
|
||||
0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6a, 0x77, 0x6b, 0x73, 0x18, 0x04, 0x20,
|
||||
0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72,
|
||||
0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2e,
|
||||
0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x4a, 0x77, 0x6b, 0x73, 0x45, 0x6e, 0x74,
|
||||
0x72, 0x79, 0x52, 0x0d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x4a, 0x77, 0x6b,
|
||||
0x73, 0x1a, 0x40, 0x0a, 0x12, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x4a, 0x77,
|
||||
0x6b, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
|
||||
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
|
||||
0x02, 0x38, 0x01, 0x42, 0x7c, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76,
|
||||
0x31, 0x42, 0x0c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50,
|
||||
0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e,
|
||||
0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69,
|
||||
0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58,
|
||||
0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c,
|
||||
0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d,
|
||||
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56,
|
||||
0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -1833,15 +2143,15 @@ func file_did_v1_account_proto_rawDescGZIP() []byte {
|
||||
return file_did_v1_account_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_did_v1_account_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_did_v1_account_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_did_v1_account_proto_goTypes = []interface{}{
|
||||
(*DIDDocument)(nil), // 0: did.v1.DIDDocument
|
||||
(*VerificationMethod)(nil), // 1: did.v1.VerificationMethod
|
||||
(*PublicKey)(nil), // 2: did.v1.PublicKey
|
||||
nil, // 2: did.v1.VerificationMethod.PublicKeyJwksEntry
|
||||
}
|
||||
var file_did_v1_account_proto_depIdxs = []int32{
|
||||
1, // 0: did.v1.DIDDocument.verification_methods:type_name -> did.v1.VerificationMethod
|
||||
2, // 1: did.v1.VerificationMethod.public_key:type_name -> did.v1.PublicKey
|
||||
2, // 1: did.v1.VerificationMethod.public_key_jwks:type_name -> did.v1.VerificationMethod.PublicKeyJwksEntry
|
||||
2, // [2:2] is the sub-list for method output_type
|
||||
2, // [2:2] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
@@ -1887,7 +2197,7 @@ func file_did_v1_account_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_did_v1_account_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumMessages: 3,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
||||
+11
-636
@@ -1137,556 +1137,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods {
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
md_PublicKey protoreflect.MessageDescriptor
|
||||
fd_PublicKey_key protoreflect.FieldDescriptor
|
||||
fd_PublicKey_key_type protoreflect.FieldDescriptor
|
||||
fd_PublicKey_did protoreflect.FieldDescriptor
|
||||
)
|
||||
|
||||
func init() {
|
||||
file_did_v1_genesis_proto_init()
|
||||
md_PublicKey = File_did_v1_genesis_proto.Messages().ByName("PublicKey")
|
||||
fd_PublicKey_key = md_PublicKey.Fields().ByName("key")
|
||||
fd_PublicKey_key_type = md_PublicKey.Fields().ByName("key_type")
|
||||
fd_PublicKey_did = md_PublicKey.Fields().ByName("did")
|
||||
}
|
||||
|
||||
var _ protoreflect.Message = (*fastReflection_PublicKey)(nil)
|
||||
|
||||
type fastReflection_PublicKey PublicKey
|
||||
|
||||
func (x *PublicKey) ProtoReflect() protoreflect.Message {
|
||||
return (*fastReflection_PublicKey)(x)
|
||||
}
|
||||
|
||||
func (x *PublicKey) slowProtoReflect() protoreflect.Message {
|
||||
mi := &file_did_v1_genesis_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_PublicKey_messageType fastReflection_PublicKey_messageType
|
||||
var _ protoreflect.MessageType = fastReflection_PublicKey_messageType{}
|
||||
|
||||
type fastReflection_PublicKey_messageType struct{}
|
||||
|
||||
func (x fastReflection_PublicKey_messageType) Zero() protoreflect.Message {
|
||||
return (*fastReflection_PublicKey)(nil)
|
||||
}
|
||||
func (x fastReflection_PublicKey_messageType) New() protoreflect.Message {
|
||||
return new(fastReflection_PublicKey)
|
||||
}
|
||||
func (x fastReflection_PublicKey_messageType) Descriptor() protoreflect.MessageDescriptor {
|
||||
return md_PublicKey
|
||||
}
|
||||
|
||||
// Descriptor returns message descriptor, which contains only the protobuf
|
||||
// type information for the message.
|
||||
func (x *fastReflection_PublicKey) Descriptor() protoreflect.MessageDescriptor {
|
||||
return md_PublicKey
|
||||
}
|
||||
|
||||
// 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_PublicKey) Type() protoreflect.MessageType {
|
||||
return _fastReflection_PublicKey_messageType
|
||||
}
|
||||
|
||||
// New returns a newly allocated and mutable empty message.
|
||||
func (x *fastReflection_PublicKey) New() protoreflect.Message {
|
||||
return new(fastReflection_PublicKey)
|
||||
}
|
||||
|
||||
// Interface unwraps the message reflection interface and
|
||||
// returns the underlying ProtoMessage interface.
|
||||
func (x *fastReflection_PublicKey) Interface() protoreflect.ProtoMessage {
|
||||
return (*PublicKey)(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_PublicKey) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
|
||||
if len(x.Key) != 0 {
|
||||
value := protoreflect.ValueOfBytes(x.Key)
|
||||
if !f(fd_PublicKey_key, value) {
|
||||
return
|
||||
}
|
||||
}
|
||||
if x.KeyType != "" {
|
||||
value := protoreflect.ValueOfString(x.KeyType)
|
||||
if !f(fd_PublicKey_key_type, value) {
|
||||
return
|
||||
}
|
||||
}
|
||||
if x.Did != "" {
|
||||
value := protoreflect.ValueOfString(x.Did)
|
||||
if !f(fd_PublicKey_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_PublicKey) Has(fd protoreflect.FieldDescriptor) bool {
|
||||
switch fd.FullName() {
|
||||
case "did.v1.PublicKey.key":
|
||||
return len(x.Key) != 0
|
||||
case "did.v1.PublicKey.key_type":
|
||||
return x.KeyType != ""
|
||||
case "did.v1.PublicKey.did":
|
||||
return x.Did != ""
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PublicKey"))
|
||||
}
|
||||
panic(fmt.Errorf("message did.v1.PublicKey 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_PublicKey) Clear(fd protoreflect.FieldDescriptor) {
|
||||
switch fd.FullName() {
|
||||
case "did.v1.PublicKey.key":
|
||||
x.Key = nil
|
||||
case "did.v1.PublicKey.key_type":
|
||||
x.KeyType = ""
|
||||
case "did.v1.PublicKey.did":
|
||||
x.Did = ""
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PublicKey"))
|
||||
}
|
||||
panic(fmt.Errorf("message did.v1.PublicKey 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_PublicKey) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch descriptor.FullName() {
|
||||
case "did.v1.PublicKey.key":
|
||||
value := x.Key
|
||||
return protoreflect.ValueOfBytes(value)
|
||||
case "did.v1.PublicKey.key_type":
|
||||
value := x.KeyType
|
||||
return protoreflect.ValueOfString(value)
|
||||
case "did.v1.PublicKey.did":
|
||||
value := x.Did
|
||||
return protoreflect.ValueOfString(value)
|
||||
default:
|
||||
if descriptor.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PublicKey"))
|
||||
}
|
||||
panic(fmt.Errorf("message did.v1.PublicKey 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_PublicKey) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
|
||||
switch fd.FullName() {
|
||||
case "did.v1.PublicKey.key":
|
||||
x.Key = value.Bytes()
|
||||
case "did.v1.PublicKey.key_type":
|
||||
x.KeyType = value.Interface().(string)
|
||||
case "did.v1.PublicKey.did":
|
||||
x.Did = value.Interface().(string)
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PublicKey"))
|
||||
}
|
||||
panic(fmt.Errorf("message did.v1.PublicKey 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_PublicKey) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch fd.FullName() {
|
||||
case "did.v1.PublicKey.key":
|
||||
panic(fmt.Errorf("field key of message did.v1.PublicKey is not mutable"))
|
||||
case "did.v1.PublicKey.key_type":
|
||||
panic(fmt.Errorf("field key_type of message did.v1.PublicKey is not mutable"))
|
||||
case "did.v1.PublicKey.did":
|
||||
panic(fmt.Errorf("field did of message did.v1.PublicKey is not mutable"))
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PublicKey"))
|
||||
}
|
||||
panic(fmt.Errorf("message did.v1.PublicKey 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_PublicKey) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
|
||||
switch fd.FullName() {
|
||||
case "did.v1.PublicKey.key":
|
||||
return protoreflect.ValueOfBytes(nil)
|
||||
case "did.v1.PublicKey.key_type":
|
||||
return protoreflect.ValueOfString("")
|
||||
case "did.v1.PublicKey.did":
|
||||
return protoreflect.ValueOfString("")
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.PublicKey"))
|
||||
}
|
||||
panic(fmt.Errorf("message did.v1.PublicKey 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_PublicKey) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
|
||||
switch d.FullName() {
|
||||
default:
|
||||
panic(fmt.Errorf("%s is not a oneof field in did.v1.PublicKey", 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_PublicKey) 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_PublicKey) 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_PublicKey) 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_PublicKey) ProtoMethods() *protoiface.Methods {
|
||||
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
|
||||
x := input.Message.Interface().(*PublicKey)
|
||||
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.Key)
|
||||
if l > 0 {
|
||||
n += 1 + l + runtime.Sov(uint64(l))
|
||||
}
|
||||
l = len(x.KeyType)
|
||||
if l > 0 {
|
||||
n += 1 + l + runtime.Sov(uint64(l))
|
||||
}
|
||||
l = len(x.Did)
|
||||
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().(*PublicKey)
|
||||
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.Did) > 0 {
|
||||
i -= len(x.Did)
|
||||
copy(dAtA[i:], x.Did)
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Did)))
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
if len(x.KeyType) > 0 {
|
||||
i -= len(x.KeyType)
|
||||
copy(dAtA[i:], x.KeyType)
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.KeyType)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if len(x.Key) > 0 {
|
||||
i -= len(x.Key)
|
||||
copy(dAtA[i:], x.Key)
|
||||
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Key)))
|
||||
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().(*PublicKey)
|
||||
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: PublicKey: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: PublicKey: 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 Key", 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.Key = append(x.Key[:0], dAtA[iNdEx:postIndex]...)
|
||||
if x.Key == nil {
|
||||
x.Key = []byte{}
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field KeyType", 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.KeyType = 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 Did", 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.Did = 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
|
||||
@@ -1801,61 +1251,6 @@ func (x *Params) GetEncryptionRewardRate() float64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// PublicKey is the struct that represents a public key
|
||||
type PublicKey struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Key is the public key
|
||||
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
|
||||
// Type is the type of the public key
|
||||
KeyType string `protobuf:"bytes,2,opt,name=key_type,json=keyType,proto3" json:"key_type,omitempty"`
|
||||
// DID is the DID of the public key
|
||||
Did string `protobuf:"bytes,3,opt,name=did,proto3" json:"did,omitempty"`
|
||||
}
|
||||
|
||||
func (x *PublicKey) Reset() {
|
||||
*x = PublicKey{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_did_v1_genesis_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *PublicKey) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*PublicKey) ProtoMessage() {}
|
||||
|
||||
// Deprecated: Use PublicKey.ProtoReflect.Descriptor instead.
|
||||
func (*PublicKey) Descriptor() ([]byte, []int) {
|
||||
return file_did_v1_genesis_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *PublicKey) GetKey() []byte {
|
||||
if x != nil {
|
||||
return x.Key
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *PublicKey) GetKeyType() string {
|
||||
if x != nil {
|
||||
return x.KeyType
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *PublicKey) GetDid() string {
|
||||
if x != nil {
|
||||
return x.Did
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_did_v1_genesis_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_did_v1_genesis_proto_rawDesc = []byte{
|
||||
@@ -1882,22 +1277,15 @@ var file_did_v1_genesis_proto_rawDesc = []byte{
|
||||
0x20, 0x01, 0x28, 0x01, 0x52, 0x14, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x61, 0x74, 0x65, 0x3a, 0x17, 0x98, 0xa0, 0x1f, 0x00,
|
||||
0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0a, 0x64, 0x69, 0x64, 0x2f, 0x70, 0x61, 0x72,
|
||||
0x61, 0x6d, 0x73, 0x22, 0x70, 0x0a, 0x09, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79,
|
||||
0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b,
|
||||
0x65, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a,
|
||||
0x03, 0x64, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x3a,
|
||||
0x24, 0x98, 0xa0, 0x1f, 0x00, 0x8a, 0xe7, 0xb0, 0x2a, 0x0d, 0x64, 0x69, 0x64, 0x2f, 0x70, 0x75,
|
||||
0x62, 0x6c, 0x69, 0x63, 0x6b, 0x65, 0x79, 0x92, 0xe7, 0xb0, 0x2a, 0x09, 0x6b, 0x65, 0x79, 0x5f,
|
||||
0x66, 0x69, 0x65, 0x6c, 0x64, 0x42, 0x7c, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64,
|
||||
0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
|
||||
0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f,
|
||||
0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44,
|
||||
0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69,
|
||||
0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50,
|
||||
0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a,
|
||||
0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x61, 0x6d, 0x73, 0x42, 0x7c, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76,
|
||||
0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50,
|
||||
0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e,
|
||||
0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69,
|
||||
0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58,
|
||||
0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c,
|
||||
0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d,
|
||||
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56,
|
||||
0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -1912,11 +1300,10 @@ func file_did_v1_genesis_proto_rawDescGZIP() []byte {
|
||||
return file_did_v1_genesis_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_did_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_did_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_did_v1_genesis_proto_goTypes = []interface{}{
|
||||
(*GenesisState)(nil), // 0: did.v1.GenesisState
|
||||
(*Params)(nil), // 1: did.v1.Params
|
||||
(*PublicKey)(nil), // 2: did.v1.PublicKey
|
||||
}
|
||||
var file_did_v1_genesis_proto_depIdxs = []int32{
|
||||
1, // 0: did.v1.GenesisState.params:type_name -> did.v1.Params
|
||||
@@ -1957,18 +1344,6 @@ func file_did_v1_genesis_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_did_v1_genesis_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PublicKey); 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{
|
||||
@@ -1976,7 +1351,7 @@ func file_did_v1_genesis_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_did_v1_genesis_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 3,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
||||
@@ -9,6 +9,120 @@ import (
|
||||
ormerrors "cosmossdk.io/orm/types/ormerrors"
|
||||
)
|
||||
|
||||
type AssertionTable interface {
|
||||
Insert(ctx context.Context, assertion *Assertion) error
|
||||
Update(ctx context.Context, assertion *Assertion) error
|
||||
Save(ctx context.Context, assertion *Assertion) error
|
||||
Delete(ctx context.Context, assertion *Assertion) error
|
||||
Has(ctx context.Context, id string) (found bool, err error)
|
||||
// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
|
||||
Get(ctx context.Context, id string) (*Assertion, error)
|
||||
List(ctx context.Context, prefixKey AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error)
|
||||
ListRange(ctx context.Context, from, to AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error)
|
||||
DeleteBy(ctx context.Context, prefixKey AssertionIndexKey) error
|
||||
DeleteRange(ctx context.Context, from, to AssertionIndexKey) error
|
||||
|
||||
doNotImplement()
|
||||
}
|
||||
|
||||
type AssertionIterator struct {
|
||||
ormtable.Iterator
|
||||
}
|
||||
|
||||
func (i AssertionIterator) Value() (*Assertion, error) {
|
||||
var assertion Assertion
|
||||
err := i.UnmarshalMessage(&assertion)
|
||||
return &assertion, err
|
||||
}
|
||||
|
||||
type AssertionIndexKey interface {
|
||||
id() uint32
|
||||
values() []interface{}
|
||||
assertionIndexKey()
|
||||
}
|
||||
|
||||
// primary key starting index..
|
||||
type AssertionPrimaryKey = AssertionIdIndexKey
|
||||
|
||||
type AssertionIdIndexKey struct {
|
||||
vs []interface{}
|
||||
}
|
||||
|
||||
func (x AssertionIdIndexKey) id() uint32 { return 0 }
|
||||
func (x AssertionIdIndexKey) values() []interface{} { return x.vs }
|
||||
func (x AssertionIdIndexKey) assertionIndexKey() {}
|
||||
|
||||
func (this AssertionIdIndexKey) WithId(id string) AssertionIdIndexKey {
|
||||
this.vs = []interface{}{id}
|
||||
return this
|
||||
}
|
||||
|
||||
type assertionTable struct {
|
||||
table ormtable.Table
|
||||
}
|
||||
|
||||
func (this assertionTable) Insert(ctx context.Context, assertion *Assertion) error {
|
||||
return this.table.Insert(ctx, assertion)
|
||||
}
|
||||
|
||||
func (this assertionTable) Update(ctx context.Context, assertion *Assertion) error {
|
||||
return this.table.Update(ctx, assertion)
|
||||
}
|
||||
|
||||
func (this assertionTable) Save(ctx context.Context, assertion *Assertion) error {
|
||||
return this.table.Save(ctx, assertion)
|
||||
}
|
||||
|
||||
func (this assertionTable) Delete(ctx context.Context, assertion *Assertion) error {
|
||||
return this.table.Delete(ctx, assertion)
|
||||
}
|
||||
|
||||
func (this assertionTable) Has(ctx context.Context, id string) (found bool, err error) {
|
||||
return this.table.PrimaryKey().Has(ctx, id)
|
||||
}
|
||||
|
||||
func (this assertionTable) Get(ctx context.Context, id string) (*Assertion, error) {
|
||||
var assertion Assertion
|
||||
found, err := this.table.PrimaryKey().Get(ctx, &assertion, id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !found {
|
||||
return nil, ormerrors.NotFound
|
||||
}
|
||||
return &assertion, nil
|
||||
}
|
||||
|
||||
func (this assertionTable) List(ctx context.Context, prefixKey AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error) {
|
||||
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
|
||||
return AssertionIterator{it}, err
|
||||
}
|
||||
|
||||
func (this assertionTable) ListRange(ctx context.Context, from, to AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error) {
|
||||
it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...)
|
||||
return AssertionIterator{it}, err
|
||||
}
|
||||
|
||||
func (this assertionTable) DeleteBy(ctx context.Context, prefixKey AssertionIndexKey) error {
|
||||
return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...)
|
||||
}
|
||||
|
||||
func (this assertionTable) DeleteRange(ctx context.Context, from, to AssertionIndexKey) error {
|
||||
return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values())
|
||||
}
|
||||
|
||||
func (this assertionTable) doNotImplement() {}
|
||||
|
||||
var _ AssertionTable = assertionTable{}
|
||||
|
||||
func NewAssertionTable(db ormtable.Schema) (AssertionTable, error) {
|
||||
table := db.GetTable(&Assertion{})
|
||||
if table == nil {
|
||||
return nil, ormerrors.TableNotFound.Wrap(string((&Assertion{}).ProtoReflect().Descriptor().FullName()))
|
||||
}
|
||||
return assertionTable{table}, nil
|
||||
}
|
||||
|
||||
type AttestationTable interface {
|
||||
Insert(ctx context.Context, attestation *Attestation) error
|
||||
Update(ctx context.Context, attestation *Attestation) error
|
||||
@@ -466,6 +580,7 @@ func NewServiceTable(db ormtable.Schema) (ServiceTable, error) {
|
||||
}
|
||||
|
||||
type StateStore interface {
|
||||
AssertionTable() AssertionTable
|
||||
AttestationTable() AttestationTable
|
||||
ControllerTable() ControllerTable
|
||||
DelegationTable() DelegationTable
|
||||
@@ -475,12 +590,17 @@ type StateStore interface {
|
||||
}
|
||||
|
||||
type stateStore struct {
|
||||
assertion AssertionTable
|
||||
attestation AttestationTable
|
||||
controller ControllerTable
|
||||
delegation DelegationTable
|
||||
service ServiceTable
|
||||
}
|
||||
|
||||
func (x stateStore) AssertionTable() AssertionTable {
|
||||
return x.assertion
|
||||
}
|
||||
|
||||
func (x stateStore) AttestationTable() AttestationTable {
|
||||
return x.attestation
|
||||
}
|
||||
@@ -502,6 +622,11 @@ func (stateStore) doNotImplement() {}
|
||||
var _ StateStore = stateStore{}
|
||||
|
||||
func NewStateStore(db ormtable.Schema) (StateStore, error) {
|
||||
assertionTable, err := NewAssertionTable(db)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
attestationTable, err := NewAttestationTable(db)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -523,6 +648,7 @@ func NewStateStore(db ormtable.Schema) (StateStore, error) {
|
||||
}
|
||||
|
||||
return stateStore{
|
||||
assertionTable,
|
||||
attestationTable,
|
||||
controllerTable,
|
||||
delegationTable,
|
||||
|
||||
+1510
-164
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user