From 54d6f3de55da044e0ff5446d7ef98d9bee5a2515 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 2 Jul 2021 08:54:07 +0300 Subject: [PATCH] [#660] core/container: Use version.IsValid in CheckFormat Container can have version later than the current lib version, and it should not be considered as invalid. But it should still have adequate version. Signed-off-by: Leonard Lyubich --- pkg/core/container/fmt.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/core/container/fmt.go b/pkg/core/container/fmt.go index e63673e5e..024d085dd 100644 --- a/pkg/core/container/fmt.go +++ b/pkg/core/container/fmt.go @@ -4,9 +4,9 @@ import ( "errors" "fmt" - "github.com/nspcc-dev/neofs-api-go/pkg" "github.com/nspcc-dev/neofs-api-go/pkg/container" "github.com/nspcc-dev/neofs-api-go/pkg/owner" + "github.com/nspcc-dev/neofs-node/pkg/core/version" ) var ( @@ -24,8 +24,8 @@ func CheckFormat(c *container.Container) error { return errNilPolicy } - if err := pkg.IsSupportedVersion(c.Version()); err != nil { - return fmt.Errorf("incorrect version: %w", err) + if v := c.Version(); v == nil || !version.IsValid(*v) { + return fmt.Errorf("incorrect version %s", v) } if ln := len(c.OwnerID().ToV2().GetValue()); ln != owner.NEO3WalletSize {