refactor: add field to

This commit is contained in:
Prad Nukala 2024-08-31 16:54:16 -04:00
parent e668d5f2cb
commit ec399eb275
6 changed files with 477 additions and 1472 deletions

View File

View File

@ -9,156 +9,6 @@ import (
ormerrors "cosmossdk.io/orm/types/ormerrors"
)
type AliasesTable interface {
Insert(ctx context.Context, aliases *Aliases) error
Update(ctx context.Context, aliases *Aliases) error
Save(ctx context.Context, aliases *Aliases) error
Delete(ctx context.Context, aliases *Aliases) 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) (*Aliases, error)
HasBySubject(ctx context.Context, subject string) (found bool, err error)
// GetBySubject returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetBySubject(ctx context.Context, subject string) (*Aliases, error)
List(ctx context.Context, prefixKey AliasesIndexKey, opts ...ormlist.Option) (AliasesIterator, error)
ListRange(ctx context.Context, from, to AliasesIndexKey, opts ...ormlist.Option) (AliasesIterator, error)
DeleteBy(ctx context.Context, prefixKey AliasesIndexKey) error
DeleteRange(ctx context.Context, from, to AliasesIndexKey) error
doNotImplement()
}
type AliasesIterator struct {
ormtable.Iterator
}
func (i AliasesIterator) Value() (*Aliases, error) {
var aliases Aliases
err := i.UnmarshalMessage(&aliases)
return &aliases, err
}
type AliasesIndexKey interface {
id() uint32
values() []interface{}
aliasesIndexKey()
}
// primary key starting index..
type AliasesPrimaryKey = AliasesIdIndexKey
type AliasesIdIndexKey struct {
vs []interface{}
}
func (x AliasesIdIndexKey) id() uint32 { return 0 }
func (x AliasesIdIndexKey) values() []interface{} { return x.vs }
func (x AliasesIdIndexKey) aliasesIndexKey() {}
func (this AliasesIdIndexKey) WithId(id string) AliasesIdIndexKey {
this.vs = []interface{}{id}
return this
}
type AliasesSubjectIndexKey struct {
vs []interface{}
}
func (x AliasesSubjectIndexKey) id() uint32 { return 1 }
func (x AliasesSubjectIndexKey) values() []interface{} { return x.vs }
func (x AliasesSubjectIndexKey) aliasesIndexKey() {}
func (this AliasesSubjectIndexKey) WithSubject(subject string) AliasesSubjectIndexKey {
this.vs = []interface{}{subject}
return this
}
type aliasesTable struct {
table ormtable.Table
}
func (this aliasesTable) Insert(ctx context.Context, aliases *Aliases) error {
return this.table.Insert(ctx, aliases)
}
func (this aliasesTable) Update(ctx context.Context, aliases *Aliases) error {
return this.table.Update(ctx, aliases)
}
func (this aliasesTable) Save(ctx context.Context, aliases *Aliases) error {
return this.table.Save(ctx, aliases)
}
func (this aliasesTable) Delete(ctx context.Context, aliases *Aliases) error {
return this.table.Delete(ctx, aliases)
}
func (this aliasesTable) Has(ctx context.Context, id string) (found bool, err error) {
return this.table.PrimaryKey().Has(ctx, id)
}
func (this aliasesTable) Get(ctx context.Context, id string) (*Aliases, error) {
var aliases Aliases
found, err := this.table.PrimaryKey().Get(ctx, &aliases, id)
if err != nil {
return nil, err
}
if !found {
return nil, ormerrors.NotFound
}
return &aliases, nil
}
func (this aliasesTable) HasBySubject(ctx context.Context, subject string) (found bool, err error) {
return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx,
subject,
)
}
func (this aliasesTable) GetBySubject(ctx context.Context, subject string) (*Aliases, error) {
var aliases Aliases
found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &aliases,
subject,
)
if err != nil {
return nil, err
}
if !found {
return nil, ormerrors.NotFound
}
return &aliases, nil
}
func (this aliasesTable) List(ctx context.Context, prefixKey AliasesIndexKey, opts ...ormlist.Option) (AliasesIterator, error) {
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
return AliasesIterator{it}, err
}
func (this aliasesTable) ListRange(ctx context.Context, from, to AliasesIndexKey, opts ...ormlist.Option) (AliasesIterator, error) {
it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...)
return AliasesIterator{it}, err
}
func (this aliasesTable) DeleteBy(ctx context.Context, prefixKey AliasesIndexKey) error {
return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...)
}
func (this aliasesTable) DeleteRange(ctx context.Context, from, to AliasesIndexKey) error {
return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values())
}
func (this aliasesTable) doNotImplement() {}
var _ AliasesTable = aliasesTable{}
func NewAliasesTable(db ormtable.Schema) (AliasesTable, error) {
table := db.GetTable(&Aliases{})
if table == nil {
return nil, ormerrors.TableNotFound.Wrap(string((&Aliases{}).ProtoReflect().Descriptor().FullName()))
}
return aliasesTable{table}, nil
}
type AssertionTable interface {
Insert(ctx context.Context, assertion *Assertion) error
Update(ctx context.Context, assertion *Assertion) error
@ -281,6 +131,9 @@ type AttestationTable interface {
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) (*Attestation, error)
HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error)
// GetBySubjectOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Attestation, error)
List(ctx context.Context, prefixKey AttestationIndexKey, opts ...ormlist.Option) (AttestationIterator, error)
ListRange(ctx context.Context, from, to AttestationIndexKey, opts ...ormlist.Option) (AttestationIterator, error)
DeleteBy(ctx context.Context, prefixKey AttestationIndexKey) error
@ -321,6 +174,24 @@ func (this AttestationIdIndexKey) WithId(id string) AttestationIdIndexKey {
return this
}
type AttestationSubjectOriginIndexKey struct {
vs []interface{}
}
func (x AttestationSubjectOriginIndexKey) id() uint32 { return 1 }
func (x AttestationSubjectOriginIndexKey) values() []interface{} { return x.vs }
func (x AttestationSubjectOriginIndexKey) attestationIndexKey() {}
func (this AttestationSubjectOriginIndexKey) WithSubject(subject string) AttestationSubjectOriginIndexKey {
this.vs = []interface{}{subject}
return this
}
func (this AttestationSubjectOriginIndexKey) WithSubjectOrigin(subject string, origin string) AttestationSubjectOriginIndexKey {
this.vs = []interface{}{subject, origin}
return this
}
type attestationTable struct {
table ormtable.Table
}
@ -357,6 +228,28 @@ func (this attestationTable) Get(ctx context.Context, id string) (*Attestation,
return &attestation, nil
}
func (this attestationTable) HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error) {
return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx,
subject,
origin,
)
}
func (this attestationTable) GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Attestation, error) {
var attestation Attestation
found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &attestation,
subject,
origin,
)
if err != nil {
return nil, err
}
if !found {
return nil, ormerrors.NotFound
}
return &attestation, nil
}
func (this attestationTable) List(ctx context.Context, prefixKey AttestationIndexKey, opts ...ormlist.Option) (AttestationIterator, error) {
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
return AttestationIterator{it}, err
@ -730,7 +623,6 @@ func NewServiceTable(db ormtable.Schema) (ServiceTable, error) {
}
type StateStore interface {
AliasesTable() AliasesTable
AssertionTable() AssertionTable
AttestationTable() AttestationTable
ControllerTable() ControllerTable
@ -741,7 +633,6 @@ type StateStore interface {
}
type stateStore struct {
aliases AliasesTable
assertion AssertionTable
attestation AttestationTable
controller ControllerTable
@ -749,10 +640,6 @@ type stateStore struct {
service ServiceTable
}
func (x stateStore) AliasesTable() AliasesTable {
return x.aliases
}
func (x stateStore) AssertionTable() AssertionTable {
return x.assertion
}
@ -778,11 +665,6 @@ func (stateStore) doNotImplement() {}
var _ StateStore = stateStore{}
func NewStateStore(db ormtable.Schema) (StateStore, error) {
aliasesTable, err := NewAliasesTable(db)
if err != nil {
return nil, err
}
assertionTable, err := NewAssertionTable(db)
if err != nil {
return nil, err
@ -809,7 +691,6 @@ func NewStateStore(db ormtable.Schema) (StateStore, error) {
}
return stateStore{
aliasesTable,
assertionTable,
attestationTable,
controllerTable,

File diff suppressed because it is too large Load Diff

View File

@ -1,40 +1,17 @@
syntax = "proto3";
package did.v1;
option go_package = "github.com/onsonr/hway/x/did/types";
import "cosmos/orm/v1/orm.proto";
import "did/v1/genesis.proto";
import "did/v1/models.proto";
// Aliases represents the `alsoKnownAs` property associated with a DID Controller
message Aliases {
option (cosmos.orm.v1.table) = {
id: 1
primary_key: {fields: "id"}
index: { id: 1, fields: "subject", unique: true }
};
// The unique identifier of the alias
string id = 1;
// Origin is the Alias provider
string origin = 2;
// Subject is the user defined alias
string subject = 3;
// Controller of the alias
string controller = 4;
// Expiration of the alias
uint64 expiration = 5;
}
// Assertion represents strongly created credentials (e.g., Passkeys, SSH, GPG, Native Secure Enclaave)
message Assertion {
option (cosmos.orm.v1.table) = {
id: 2
id: 1
primary_key: {fields: "id"}
};
@ -57,8 +34,9 @@ message Assertion {
// Attestation represents linked identifiers (e.g., Crypto Accounts, Github, Email, Phone)
message Attestation {
option (cosmos.orm.v1.table) = {
id: 3
id: 2
primary_key: {fields: "id"}
index: { id: 1, fields: "subject,origin", unique: true }
};
// The unique identifier of the attestation
@ -70,15 +48,21 @@ message Attestation {
// The value of the linked identifier
PubKey public_key = 3;
// The origin of the attestation
string origin = 4;
// The subject of the attestation
string subject = 5;
// The controller of the attestation
Metadata metadata = 4;
Metadata metadata = 6;
}
// Controller represents a Sonr DWN Vault
message Controller {
option (cosmos.orm.v1.table) = {
id: 4
id: 3
primary_key: {fields: "id"}
};
@ -98,7 +82,7 @@ message Controller {
// Delegation represents IBC Account Controllers for various chains (e.g., ETH, BTC)
message Delegation {
option (cosmos.orm.v1.table) = {
id: 5
id: 4
primary_key: {fields: "id"}
};
@ -118,7 +102,7 @@ message Delegation {
// Service represents a service in a DID Document
message Service {
option (cosmos.orm.v1.table) = {
id: 6
id: 5
primary_key: {fields: "id"}
};

View File

@ -1 +1,9 @@
package keeper
// deriveAccount is used to derive a wallet account using bip32
func (k Keeper) deriveAccount() {
}
// insertAccount places an Account into the did module orm as a Delegation
func (k Keeper) insertAccount() {
}

View File

@ -23,88 +23,6 @@ var _ = math.Inf
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// Aliases represents the `alsoKnownAs` property associated with a DID Controller
type Aliases struct {
// The unique identifier of the alias
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// Origin is the Alias provider
Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"`
// Subject is the user defined alias
Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"`
// Controller of the alias
Controller string `protobuf:"bytes,4,opt,name=controller,proto3" json:"controller,omitempty"`
// Expiration of the alias
Expiration uint64 `protobuf:"varint,5,opt,name=expiration,proto3" json:"expiration,omitempty"`
}
func (m *Aliases) Reset() { *m = Aliases{} }
func (m *Aliases) String() string { return proto.CompactTextString(m) }
func (*Aliases) ProtoMessage() {}
func (*Aliases) Descriptor() ([]byte, []int) {
return fileDescriptor_f44bb702879c34b4, []int{0}
}
func (m *Aliases) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Aliases) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Aliases.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 *Aliases) XXX_Merge(src proto.Message) {
xxx_messageInfo_Aliases.Merge(m, src)
}
func (m *Aliases) XXX_Size() int {
return m.Size()
}
func (m *Aliases) XXX_DiscardUnknown() {
xxx_messageInfo_Aliases.DiscardUnknown(m)
}
var xxx_messageInfo_Aliases proto.InternalMessageInfo
func (m *Aliases) GetId() string {
if m != nil {
return m.Id
}
return ""
}
func (m *Aliases) GetOrigin() string {
if m != nil {
return m.Origin
}
return ""
}
func (m *Aliases) GetSubject() string {
if m != nil {
return m.Subject
}
return ""
}
func (m *Aliases) GetController() string {
if m != nil {
return m.Controller
}
return ""
}
func (m *Aliases) GetExpiration() uint64 {
if m != nil {
return m.Expiration
}
return 0
}
// Assertion represents strongly created credentials (e.g., Passkeys, SSH, GPG, Native Secure Enclaave)
type Assertion struct {
// The unique identifier of the attestation
@ -123,7 +41,7 @@ func (m *Assertion) Reset() { *m = Assertion{} }
func (m *Assertion) String() string { return proto.CompactTextString(m) }
func (*Assertion) ProtoMessage() {}
func (*Assertion) Descriptor() ([]byte, []int) {
return fileDescriptor_f44bb702879c34b4, []int{1}
return fileDescriptor_f44bb702879c34b4, []int{0}
}
func (m *Assertion) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -195,15 +113,19 @@ type Attestation struct {
Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"`
// The value of the linked identifier
PublicKey *PubKey `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
// The origin of the attestation
Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"`
// The subject of the attestation
Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"`
// The controller of the attestation
Metadata *Metadata `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"`
Metadata *Metadata `protobuf:"bytes,6,opt,name=metadata,proto3" json:"metadata,omitempty"`
}
func (m *Attestation) Reset() { *m = Attestation{} }
func (m *Attestation) String() string { return proto.CompactTextString(m) }
func (*Attestation) ProtoMessage() {}
func (*Attestation) Descriptor() ([]byte, []int) {
return fileDescriptor_f44bb702879c34b4, []int{2}
return fileDescriptor_f44bb702879c34b4, []int{1}
}
func (m *Attestation) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -253,6 +175,20 @@ func (m *Attestation) GetPublicKey() *PubKey {
return nil
}
func (m *Attestation) GetOrigin() string {
if m != nil {
return m.Origin
}
return ""
}
func (m *Attestation) GetSubject() string {
if m != nil {
return m.Subject
}
return ""
}
func (m *Attestation) GetMetadata() *Metadata {
if m != nil {
return m.Metadata
@ -276,7 +212,7 @@ func (m *Controller) Reset() { *m = Controller{} }
func (m *Controller) String() string { return proto.CompactTextString(m) }
func (*Controller) ProtoMessage() {}
func (*Controller) Descriptor() ([]byte, []int) {
return fileDescriptor_f44bb702879c34b4, []int{3}
return fileDescriptor_f44bb702879c34b4, []int{2}
}
func (m *Controller) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -349,7 +285,7 @@ func (m *Delegation) Reset() { *m = Delegation{} }
func (m *Delegation) String() string { return proto.CompactTextString(m) }
func (*Delegation) ProtoMessage() {}
func (*Delegation) Descriptor() ([]byte, []int) {
return fileDescriptor_f44bb702879c34b4, []int{4}
return fileDescriptor_f44bb702879c34b4, []int{3}
}
func (m *Delegation) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -426,7 +362,7 @@ func (m *Service) Reset() { *m = Service{} }
func (m *Service) String() string { return proto.CompactTextString(m) }
func (*Service) ProtoMessage() {}
func (*Service) Descriptor() ([]byte, []int) {
return fileDescriptor_f44bb702879c34b4, []int{5}
return fileDescriptor_f44bb702879c34b4, []int{4}
}
func (m *Service) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -498,7 +434,6 @@ func (m *Service) GetPermissions() *Permissions {
}
func init() {
proto.RegisterType((*Aliases)(nil), "did.v1.Aliases")
proto.RegisterType((*Assertion)(nil), "did.v1.Assertion")
proto.RegisterType((*Attestation)(nil), "did.v1.Attestation")
proto.RegisterType((*Controller)(nil), "did.v1.Controller")
@ -510,104 +445,46 @@ func init() {
func init() { proto.RegisterFile("did/v1/state.proto", fileDescriptor_f44bb702879c34b4) }
var fileDescriptor_f44bb702879c34b4 = []byte{
// 645 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x94, 0xcf, 0x6e, 0xd3, 0x4a,
0x14, 0xc6, 0x3b, 0xf9, 0xdb, 0x1c, 0x37, 0x51, 0xee, 0xb4, 0xf7, 0xd6, 0xea, 0x55, 0xad, 0x62,
0x54, 0xa9, 0x0b, 0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0xac, 0xa5,
0xcb, 0x2b, 0x6b, 0xe9, 0xeb, 0x95, 0xb5, 0xf4, 0xc2, 0x1e, 0x31, 0x7d, 0x9e, 0x0c, 0x07, 0x81,
0x88, 0x1c, 0xc1, 0x95, 0xe0, 0xd2, 0x39, 0x7f, 0xed, 0xa7, 0xce, 0x85, 0x93, 0xdd, 0x86, 0x59,
0xea, 0x6a, 0xd8, 0xca, 0xaf, 0xc2, 0x7b, 0x3f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x0b, 0x4a, 0x67,
0x3c, 0x6c, 0x05, 0x00, 0x00,
}
func (m *Aliases) 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 *Aliases) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Aliases) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.Expiration != 0 {
i = encodeVarintState(dAtA, i, uint64(m.Expiration))
i--
dAtA[i] = 0x28
}
if len(m.Controller) > 0 {
i -= len(m.Controller)
copy(dAtA[i:], m.Controller)
i = encodeVarintState(dAtA, i, uint64(len(m.Controller)))
i--
dAtA[i] = 0x22
}
if len(m.Subject) > 0 {
i -= len(m.Subject)
copy(dAtA[i:], m.Subject)
i = encodeVarintState(dAtA, i, uint64(len(m.Subject)))
i--
dAtA[i] = 0x1a
}
if len(m.Origin) > 0 {
i -= len(m.Origin)
copy(dAtA[i:], m.Origin)
i = encodeVarintState(dAtA, i, uint64(len(m.Origin)))
i--
dAtA[i] = 0x12
}
if len(m.Id) > 0 {
i -= len(m.Id)
copy(dAtA[i:], m.Id)
i = encodeVarintState(dAtA, i, uint64(len(m.Id)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
// 613 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0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0x39, 0x0b,
0xa7, 0x67, 0xce, 0xc2, 0xf7, 0x33, 0x67, 0xe1, 0x95, 0x3b, 0x62, 0xfa, 0x24, 0x1d, 0x0e, 0x22,
0x91, 0x78, 0x82, 0x2b, 0xc1, 0xa5, 0x77, 0xf2, 0x36, 0xcc, 0xbc, 0x77, 0x5e, 0xfe, 0xa1, 0xca,
0x5b, 0x57, 0xc3, 0x56, 0xf1, 0x95, 0x7a, 0xf0, 0x33, 0x00, 0x00, 0xff, 0xff, 0x13, 0xa6, 0x96,
0x2c, 0x07, 0x05, 0x00, 0x00,
}
func (m *Assertion) Marshal() (dAtA []byte, err error) {
@ -708,6 +585,20 @@ func (m *Attestation) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i = encodeVarintState(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x32
}
if len(m.Subject) > 0 {
i -= len(m.Subject)
copy(dAtA[i:], m.Subject)
i = encodeVarintState(dAtA, i, uint64(len(m.Subject)))
i--
dAtA[i] = 0x2a
}
if len(m.Origin) > 0 {
i -= len(m.Origin)
copy(dAtA[i:], m.Origin)
i = encodeVarintState(dAtA, i, uint64(len(m.Origin)))
i--
dAtA[i] = 0x22
}
if m.PublicKey != nil {
@ -944,34 +835,6 @@ func encodeVarintState(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
return base
}
func (m *Aliases) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Id)
if l > 0 {
n += 1 + l + sovState(uint64(l))
}
l = len(m.Origin)
if l > 0 {
n += 1 + l + sovState(uint64(l))
}
l = len(m.Subject)
if l > 0 {
n += 1 + l + sovState(uint64(l))
}
l = len(m.Controller)
if l > 0 {
n += 1 + l + sovState(uint64(l))
}
if m.Expiration != 0 {
n += 1 + sovState(uint64(m.Expiration))
}
return n
}
func (m *Assertion) Size() (n int) {
if m == nil {
return 0
@ -1019,6 +882,14 @@ func (m *Attestation) Size() (n int) {
l = m.PublicKey.Size()
n += 1 + l + sovState(uint64(l))
}
l = len(m.Origin)
if l > 0 {
n += 1 + l + sovState(uint64(l))
}
l = len(m.Subject)
if l > 0 {
n += 1 + l + sovState(uint64(l))
}
if m.Metadata != nil {
l = m.Metadata.Size()
n += 1 + l + sovState(uint64(l))
@ -1119,203 +990,6 @@ func sovState(x uint64) (n int) {
func sozState(x uint64) (n int) {
return sovState(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *Aliases) 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 ErrIntOverflowState
}
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: Aliases: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Aliases: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowState
}
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 ErrInvalidLengthState
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthState
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Id = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowState
}
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 ErrInvalidLengthState
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthState
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Origin = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowState
}
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 ErrInvalidLengthState
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthState
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Subject = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowState
}
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 ErrInvalidLengthState
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthState
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Controller = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 5:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType)
}
m.Expiration = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowState
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Expiration |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipState(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthState
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *Assertion) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@ -1666,6 +1340,70 @@ func (m *Attestation) Unmarshal(dAtA []byte) error {
}
iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Origin", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowState
}
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 ErrInvalidLengthState
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthState
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Origin = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 5:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowState
}
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 ErrInvalidLengthState
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthState
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Subject = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 6:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType)
}