Change timestamp condition

This commit is contained in:
mcrakhman 2023-05-04 14:58:17 +02:00 committed by Mikhail Iudin
parent 2958e32636
commit 2489e19bab
No known key found for this signature in database
GPG Key ID: FAAAA8BAABDFF1C0
2 changed files with 2 additions and 2 deletions

View File

@ -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
}

View File

@ -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()