Change identity error
This commit is contained in:
parent
e34d298b8e
commit
ba39057a23
@ -1,6 +1,7 @@
|
||||
package commonspace
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/anytypeio/any-sync/commonspace/object/acl/aclrecordproto"
|
||||
"github.com/anytypeio/any-sync/commonspace/object/acl/list"
|
||||
"github.com/anytypeio/any-sync/commonspace/object/tree/objecttree"
|
||||
@ -21,6 +22,8 @@ const (
|
||||
SpaceReserved = "any-sync.space"
|
||||
)
|
||||
|
||||
var ErrIncorrectIdentity = errors.New("incorrect identity")
|
||||
|
||||
func storagePayloadForSpaceCreate(payload SpaceCreatePayload) (storagePayload spacestorage.SpaceStorageCreatePayload, err error) {
|
||||
// marshalling keys
|
||||
identity, err := payload.SigningKey.GetPublic().Marshall()
|
||||
@ -247,7 +250,7 @@ func ValidateSpaceHeader(rawHeaderWithId *spacesyncproto.RawSpaceHeaderWithId, i
|
||||
return
|
||||
}
|
||||
if !payloadIdentity.Equals(identity) {
|
||||
err = spacestorage.ErrIncorrectSpaceHeader
|
||||
err = ErrIncorrectIdentity
|
||||
return
|
||||
}
|
||||
return
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user