mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-09 09:35:03 +09:00
Change verify export
This commit is contained in:
parent
bb100994ec
commit
8feb5cd180
1 changed files with 4 additions and 1 deletions
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue