mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-11 10:18:08 +09:00
Change timeestamps
This commit is contained in:
parent
bb86e5b7e5
commit
67ca417cb8
6 changed files with 9 additions and 9 deletions
|
@ -88,7 +88,7 @@ func (a *aclRecordBuilder) BuildUserJoin(acceptPrivKeyBytes []byte, encSymKeyByt
|
|||
Identity: state.Identity(),
|
||||
Data: marshalledJoin,
|
||||
CurrentReadKeyHash: state.CurrentReadKeyHash(),
|
||||
Timestamp: time.Now().UnixNano(),
|
||||
Timestamp: time.Now().Unix(),
|
||||
}
|
||||
marshalledRecord, err := aclRecord.Marshal()
|
||||
if err != nil {
|
||||
|
|
|
@ -126,7 +126,7 @@ func (t *AclListStorageBuilder) parseRecord(rec *Record, prevId string) *aclreco
|
|||
Identity: []byte(t.keychain.GetIdentity(rec.Identity)),
|
||||
Data: bytes,
|
||||
CurrentReadKeyHash: k.Hash,
|
||||
Timestamp: time.Now().UnixNano(),
|
||||
Timestamp: time.Now().Unix(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -165,7 +165,7 @@ func (c *changeBuilder) Build(payload BuilderContent) (ch *Change, rawIdChange *
|
|||
AclHeadId: payload.AclHeadId,
|
||||
SnapshotBaseId: payload.SnapshotBaseId,
|
||||
CurrentReadKeyHash: payload.CurrentReadKeyHash,
|
||||
Timestamp: time.Now().UnixNano(),
|
||||
Timestamp: time.Now().Unix(),
|
||||
Identity: payload.Identity,
|
||||
IsSnapshot: payload.IsSnapshot,
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ func CreateObjectTreeRoot(payload ObjectTreeCreatePayload, aclList list.AclList)
|
|||
if err != nil {
|
||||
return
|
||||
}
|
||||
return createObjectTreeRoot(payload, time.Now().UnixNano(), bytes, aclList)
|
||||
return createObjectTreeRoot(payload, time.Now().Unix(), bytes, aclList)
|
||||
}
|
||||
|
||||
func DeriveObjectTreeRoot(payload ObjectTreeCreatePayload, aclList list.AclList) (root *treechangeproto.RawTreeChangeWithId, err error) {
|
||||
|
@ -126,7 +126,7 @@ func CreateObjectTree(
|
|||
if err != nil {
|
||||
return
|
||||
}
|
||||
return createObjectTree(payload, time.Now().UnixNano(), bytes, aclList, createStorage)
|
||||
return createObjectTree(payload, time.Now().Unix(), bytes, aclList, createStorage)
|
||||
}
|
||||
|
||||
func createObjectTree(
|
||||
|
|
|
@ -125,7 +125,7 @@ func TestTree_Hash(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestTree_AddFuzzy(t *testing.T) {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
rand.Seed(time.Now().Unix())
|
||||
getChanges := func() []*Change {
|
||||
changes := []*Change{
|
||||
newChange("1", "root", "root"),
|
||||
|
|
|
@ -37,7 +37,7 @@ func storagePayloadForSpaceCreate(payload SpaceCreatePayload) (storagePayload sp
|
|||
}
|
||||
header := &spacesyncproto.SpaceHeader{
|
||||
Identity: identity,
|
||||
Timestamp: time.Now().UnixNano(),
|
||||
Timestamp: time.Now().Unix(),
|
||||
SpaceType: payload.SpaceType,
|
||||
SpaceHeaderPayload: payload.SpacePayload,
|
||||
ReplicationKey: payload.ReplicationKey,
|
||||
|
@ -82,7 +82,7 @@ func storagePayloadForSpaceCreate(payload SpaceCreatePayload) (storagePayload sp
|
|||
SpaceId: spaceId,
|
||||
EncryptedReadKey: encReadKey,
|
||||
CurrentReadKeyHash: readKeyHash,
|
||||
Timestamp: time.Now().UnixNano(),
|
||||
Timestamp: time.Now().Unix(),
|
||||
}
|
||||
rawWithId, err := marshalAclRoot(aclRoot, payload.SigningKey)
|
||||
if err != nil {
|
||||
|
@ -103,7 +103,7 @@ func storagePayloadForSpaceCreate(payload SpaceCreatePayload) (storagePayload sp
|
|||
SpaceId: spaceId,
|
||||
Seed: spaceSettingsSeed,
|
||||
ChangeType: SpaceReserved,
|
||||
Timestamp: time.Now().UnixNano(),
|
||||
Timestamp: time.Now().Unix(),
|
||||
})
|
||||
if err != nil {
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue