Commit bb0d9f90 authored by Sietse Ringers's avatar Sietse Ringers
Browse files

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,11 +89,11 @@ func (rs *RevocationStorage) EnableRevocation(typ CredentialTypeIdentifier) erro ...@@ -88,11 +89,11 @@ 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,
}, },
PublicKeyIndex: sk.Counter,
CredType: typ, CredType: typ,
} }
...@@ -263,9 +264,9 @@ func (rs *RevocationStorage) revokeAttr(tx revStorage, typ CredentialTypeIdentif ...@@ -263,9 +264,9 @@ func (rs *RevocationStorage) revokeAttr(tx revStorage, typ CredentialTypeIdentif
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,
}, },
PublicKeyIndex: sk.Counter,
CredType: typ, CredType: typ,
} }
if err = rs.addRevocationRecord(tx, record, true); err != nil { if err = rs.addRevocationRecord(tx, record, true); err != nil {
......
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