Change verify export

This commit is contained in:
mcrakhman committed 2023-03-01 22:12:07 +01:00
1 parent 00c344112e
commit eae4f0a57d
1 file changed
+4 -1
+4 -1
View File
@@ -263,12 +263,15 @@ func (s *settingsObject) addContent(data []byte) (err error) {
return
}
func VerifyDeleteChange(raw *treechangeproto.RawTreeChangeWithId, peerId string) (err error) {
func VerifyDeleteChange(raw *treechangeproto.RawTreeChangeWithId, identity []byte, peerId string) (err error) {
changeBuilder := objecttree.NewChangeBuilder(keychain.NewKeychain(), nil)
res, err := changeBuilder.Unmarshall(raw, true)
if err != nil {
return
}
if res.Identity != string(identity) {
return fmt.Errorf("incorrect identity")
}
return verifyDeleteContent(res.Data, peerId)
}