From 13bd358bce8e05887dac387692141e2e6012f30d Mon Sep 17 00:00:00 2001 From: mcrakhman Date: Wed, 18 Jan 2023 10:06:01 +0100 Subject: [PATCH] Fix timestamps --- commonspace/object/tree/objecttree/change.go | 1 + commonspace/object/tree/objecttree/changebuilder.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/commonspace/object/tree/objecttree/change.go b/commonspace/object/tree/objecttree/change.go index b83cf967..8ded2d43 100644 --- a/commonspace/object/tree/objecttree/change.go +++ b/commonspace/object/tree/objecttree/change.go @@ -53,6 +53,7 @@ func NewChangeFromRoot(id string, ch *treechangeproto.RootChange, signature []by AclHeadId: ch.AclHeadId, Id: id, IsSnapshot: true, + Timestamp: ch.Timestamp, Identity: string(ch.Identity), Signature: signature, Data: []byte(ch.ChangeType), diff --git a/commonspace/object/tree/objecttree/changebuilder.go b/commonspace/object/tree/objecttree/changebuilder.go index bd53c293..03f84b4a 100644 --- a/commonspace/object/tree/objecttree/changebuilder.go +++ b/commonspace/object/tree/objecttree/changebuilder.go @@ -151,7 +151,7 @@ func (c *changeBuilder) BuildContent(payload BuilderContent) (ch *Change, rawIdC AclHeadId: payload.AclHeadId, SnapshotBaseId: payload.SnapshotBaseId, CurrentReadKeyHash: payload.CurrentReadKeyHash, - Timestamp: int64(time.Now().Nanosecond()), + Timestamp: time.Now().UnixNano(), Identity: payload.Identity, IsSnapshot: payload.IsSnapshot, }