From 49bf6b24b034e285ef16c5192f7ff0d291b00ddc Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Sat, 17 Sep 2022 10:39:11 +0400 Subject: [PATCH] [#417] storagegroup: Mark all expiration methods as deprecated `expiration_epoch` field of `StorageGroup` message has been marked as deprecated in previous NeoFS API protocol's release. Mark all method related to the field as deprecated. Leave and use them for test purposes only. Signed-off-by: Leonard Lyubich --- storagegroup/convert.go | 3 ++- storagegroup/grpc/types.go | 2 ++ storagegroup/test/generate.go | 1 + storagegroup/types.go | 4 ++++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/storagegroup/convert.go b/storagegroup/convert.go index b36101ff..3dac3999 100644 --- a/storagegroup/convert.go +++ b/storagegroup/convert.go @@ -15,6 +15,7 @@ func (s *StorageGroup) ToGRPCMessage() grpc.Message { m = new(sg.StorageGroup) m.SetMembers(refs.ObjectIDListToGRPCMessage(s.members)) + //nolint:staticcheck m.SetExpirationEpoch(s.exp) m.SetValidationDataSize(s.size) m.SetValidationHash(s.hash.ToGRPCMessage().(*refsGRPC.Checksum)) @@ -50,7 +51,7 @@ func (s *StorageGroup) FromGRPCMessage(m grpc.Message) error { return err } - //nolint: staticcheck + //nolint:staticcheck s.exp = v.GetExpirationEpoch() s.size = v.GetValidationDataSize() diff --git a/storagegroup/grpc/types.go b/storagegroup/grpc/types.go index 1c7a8a80..86280d3f 100644 --- a/storagegroup/grpc/types.go +++ b/storagegroup/grpc/types.go @@ -15,6 +15,8 @@ func (m *StorageGroup) SetValidationHash(v *refs.Checksum) { } // SetExpirationEpoch sets number of the last epoch of the storage group lifetime. +// +// Deprecated: do not use, `expiration_epoch` field is deprecated in protocol. func (m *StorageGroup) SetExpirationEpoch(v uint64) { m.ExpirationEpoch = v } diff --git a/storagegroup/test/generate.go b/storagegroup/test/generate.go index 048ec24c..80ba7b98 100644 --- a/storagegroup/test/generate.go +++ b/storagegroup/test/generate.go @@ -10,6 +10,7 @@ func GenerateStorageGroup(empty bool) *storagegroup.StorageGroup { if !empty { m.SetValidationDataSize(44) + //nolint:staticcheck m.SetExpirationEpoch(55) m.SetMembers(refstest.GenerateObjectIDs(false)) } diff --git a/storagegroup/types.go b/storagegroup/types.go index a1926c79..a03faf39 100644 --- a/storagegroup/types.go +++ b/storagegroup/types.go @@ -45,6 +45,8 @@ func (s *StorageGroup) SetValidationHash(v *refs.Checksum) { } // GetExpirationEpoch of unified storage group structure. +// +// Deprecated: Do not use. func (s *StorageGroup) GetExpirationEpoch() uint64 { if s != nil { return s.exp @@ -54,6 +56,8 @@ func (s *StorageGroup) GetExpirationEpoch() uint64 { } // SetExpirationEpoch into unified storage group structure. +// +// Deprecated: Do not use. func (s *StorageGroup) SetExpirationEpoch(v uint64) { s.exp = v }