Commit bb0d9f90 authored by Sietse Ringers's avatar Sietse Ringers

refactor: move revocation record PublicKeyIndex field from gabi to here

parent 1649a6d3
...@@ -42,6 +42,7 @@ type ( ...@@ -42,6 +42,7 @@ type (
RevocationRecord struct { RevocationRecord struct {
revocation.Record `gorm:"embedded"` revocation.Record `gorm:"embedded"`
PublicKeyIndex uint
CredType CredentialTypeIdentifier `gorm:"primary_key"` CredType CredentialTypeIdentifier `gorm:"primary_key"`
} }
...@@ -88,12 +89,12 @@ func (rs *RevocationStorage) EnableRevocation(typ CredentialTypeIdentifier) erro ...@@ -88,12 +89,12 @@ func (rs *RevocationStorage) EnableRevocation(typ CredentialTypeIdentifier) erro
} }
r := &RevocationRecord{ r := &RevocationRecord{
Record: revocation.Record{ Record: revocation.Record{
PublicKeyIndex: sk.Counter, Message: msg,
Message: msg, StartIndex: acc.Index,
StartIndex: acc.Index, EndIndex: acc.Index,
EndIndex: acc.Index,
}, },
CredType: typ, PublicKeyIndex: sk.Counter,
CredType: typ,
} }
if err = rs.AddRevocationRecord(r); err != nil { if err = rs.AddRevocationRecord(r); err != nil {
...@@ -261,12 +262,12 @@ func (rs *RevocationStorage) revokeAttr(tx revStorage, typ CredentialTypeIdentif ...@@ -261,12 +262,12 @@ func (rs *RevocationStorage) revokeAttr(tx revStorage, typ CredentialTypeIdentif
} }
record := &RevocationRecord{ record := &RevocationRecord{
Record: revocation.Record{ Record: revocation.Record{
StartIndex: newAcc.Index, StartIndex: newAcc.Index,
EndIndex: newAcc.Index, EndIndex: newAcc.Index,
PublicKeyIndex: sk.Counter, Message: updateMsg,
Message: updateMsg,
}, },
CredType: typ, PublicKeyIndex: sk.Counter,
CredType: typ,
} }
if err = rs.addRevocationRecord(tx, record, true); err != nil { if err = rs.addRevocationRecord(tx, record, true); err != nil {
return err return err
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment