Change timestamp condition

This commit is contained in:
mcrakhman authored and Mikhail Iudin committed 2023-05-04 14:58:17 +02:00
1 parent 2958e32636
commit 2489e19bab
2 files changed
+2 -2

No files matched your search

@@ -264,7 +264,7 @@ func (ot *objectTree) prepareBuilderContent(content SignableChangeContent) (cnt
PrivKey: content.Key,
ReadKey: readKey,
Content: content.Data,
Timestamp: content.Timestamp,
Timestamp: timestamp,
}
return
}
@@ -118,7 +118,7 @@ func TestObjectTree(t *testing.T) {
require.Equal(t, res.Added[0].Id, oTree.Heads()[0])
ch, err := oTree.(*objectTree).changeBuilder.Unmarshall(res.Added[0], true)
require.NoError(t, err)
require.NotEqual(t, ch.Timestamp, 0)
require.NotZero(t, ch.Timestamp)
})
t.Run("timestamp is set correctly", func(t *testing.T) {
someTs := time.Now().Add(time.Hour).Unix()