[#1442] pilorama: Generate timestamp based on node position in the container

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-05-27 15:55:02 +03:00 committed by fyrchik
parent 3caa982283
commit 4437cd7113
13 changed files with 333 additions and 169 deletions

View file

@ -133,11 +133,11 @@ func (s *state) removeChild(child, parent Node) {
}
}
func (s *state) timestamp() Timestamp {
func (s *state) timestamp(pos, size int) Timestamp {
if len(s.operations) == 0 {
return 0
return nextTimestamp(0, uint64(pos), uint64(size))
}
return s.operations[len(s.operations)-1].Time + 1
return nextTimestamp(s.operations[len(s.operations)-1].Time, uint64(pos), uint64(size))
}
func (s *state) findSpareID() Node {