diff --git a/cmd/neofs-node/container.go b/cmd/neofs-node/container.go index 2336955db0f..070bc07f279 100644 --- a/cmd/neofs-node/container.go +++ b/cmd/neofs-node/container.go @@ -150,7 +150,7 @@ func initContainerService(c *cfg) { key: pubKey, } - loadAccumulator := loadstorage.New(loadstorage.Prm{EstimationsLifeCycle: containercontract.CleanupDelta}) + loadAccumulator := loadstorage.New(containercontract.CleanupDelta) addNewEpochAsyncNotificationHandler(c, func(e event.Event) { ev := e.(netmapEv.NewEpoch) diff --git a/pkg/services/container/announcement/load/storage/storage.go b/pkg/services/container/announcement/load/storage/storage.go index fdd0a522af3..f3c9760e1ca 100644 --- a/pkg/services/container/announcement/load/storage/storage.go +++ b/pkg/services/container/announcement/load/storage/storage.go @@ -44,22 +44,18 @@ type Storage struct { mItems map[storageKey]*usedSpaceEstimations } -// Prm groups the required parameters of the Storage's constructor. -type Prm struct { - // EstimationsLifeCycle is a longevity (in epochs) of estimations - // that are kept in the [Storage] instance. Note, current epoch - // is controlled with [Storage.EpochEvent]. - EstimationsLifeCycle uint64 -} - // New creates a new instance of the Storage. // // The created Storage does not require additional // initialization and is completely ready for work. -func New(prm Prm) *Storage { +// +// estimationsLifeCycle is a longevity (in epochs) of estimations +// that are kept in the [Storage] instance. Note, current epoch +// is controlled with [Storage.EpochEvent]. +func New(estimationsLifeCycle uint64) *Storage { return &Storage{ mItems: make(map[storageKey]*usedSpaceEstimations), - estLifeCycle: prm.EstimationsLifeCycle, + estLifeCycle: estimationsLifeCycle, } } diff --git a/pkg/services/container/announcement/load/storage/storage_test.go b/pkg/services/container/announcement/load/storage/storage_test.go index 001b4508d5a..ea85f7898ed 100644 --- a/pkg/services/container/announcement/load/storage/storage_test.go +++ b/pkg/services/container/announcement/load/storage/storage_test.go @@ -18,7 +18,7 @@ func TestStorage(t *testing.T) { const opinionsNum = 100 - s := New(Prm{}) + s := New(0) opinions := make([]uint64, opinionsNum) for i := range opinions { @@ -53,7 +53,7 @@ func TestStorage_NewEpoch(t *testing.T) { const epoch uint64 = 13 const lifeCycle = 5 - s := New(Prm{EstimationsLifeCycle: lifeCycle}) + s := New(lifeCycle) var a container.SizeEstimation a.SetContainer(cidtest.ID())