From a952a406a2077c603b9feeef9395cc7aabe0dc11 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 14 Nov 2023 14:47:31 +0300 Subject: [PATCH] [#506] container: Use uint64 for epoch type It is `uint64` in netmap source interfaces and other code. Signed-off-by: Evgenii Stratonikov --- pkg/core/container/storage.go | 2 +- pkg/morph/client/container/deletion_info.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/core/container/storage.go b/pkg/core/container/storage.go index 05e8fce49..ebafd22db 100644 --- a/pkg/core/container/storage.go +++ b/pkg/core/container/storage.go @@ -28,7 +28,7 @@ type DelInfo struct { Owner user.ID // Epoch indicates when the container was removed. - Epoch int + Epoch uint64 } // Source is an interface that wraps diff --git a/pkg/morph/client/container/deletion_info.go b/pkg/morph/client/container/deletion_info.go index 61e26506d..dda6bf98c 100644 --- a/pkg/morph/client/container/deletion_info.go +++ b/pkg/morph/client/container/deletion_info.go @@ -63,13 +63,13 @@ func (c *Client) DeletionInfo(cid []byte) (*containercore.DelInfo, error) { return nil, fmt.Errorf("could not decode container owner id (%s): %w", deletionInfoMethod, err) } - epoch, err := client.IntFromStackItem(arr[1]) + epoch, err := client.BigIntFromStackItem(arr[1]) if err != nil { return nil, fmt.Errorf("could not get byte array of container signature (%s): %w", deletionInfoMethod, err) } return &containercore.DelInfo{ Owner: owner, - Epoch: int(epoch), + Epoch: epoch.Uint64(), }, nil }