From 088df0e2a9ae02fc7b8c7bc720d3092e5efe4fb2 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 11 May 2022 17:58:52 +0300 Subject: [PATCH] [#1369] version: Upgrade SDK package Signed-off-by: Leonard Lyubich --- cmd/neofs-cli/modules/container.go | 9 +++--- cmd/neofs-cli/modules/util.go | 7 +++- cmd/neofs-node/config.go | 2 +- go.mod | 2 +- go.sum | Bin 98064 -> 98064 bytes pkg/core/container/fmt_test.go | 3 +- pkg/core/version/version_test.go | 2 +- .../engine/engine_test.go | 8 ++--- pkg/local_object_storage/metabase/db_test.go | 8 ++--- pkg/local_object_storage/shard/shard_test.go | 8 ++--- pkg/services/netmap/executor.go | 30 ++++++++++++------ .../object_manager/transformer/fmt.go | 3 +- pkg/services/util/response/service.go | 12 ++++--- 13 files changed, 58 insertions(+), 36 deletions(-) diff --git a/cmd/neofs-cli/modules/container.go b/cmd/neofs-cli/modules/container.go index 90c1e932dc..fd58ac6148 100644 --- a/cmd/neofs-cli/modules/container.go +++ b/cmd/neofs-cli/modules/container.go @@ -171,8 +171,10 @@ It will be stored in sidechain when inner ring will accepts it.`, idOwner = owner.NewIDFromPublicKey(&key.PublicKey) } + ver := versionSDK.Current() + cnr := container.New() - cnr.SetVersion(versionSDK.Current()) + cnr.SetVersion(&ver) cnr.SetPlacementPolicy(placementPolicy) cnr.SetBasicACL(basicACL) cnr.SetAttributes(attributes) @@ -807,9 +809,8 @@ func parseEACL(eaclPath string) (*eacl.Table, error) { } func validateAndFixEACLVersion(table *eacl.Table) { - v := table.Version() - if !version.IsValid(v) { - table.SetVersion(*versionSDK.Current()) + if !version.IsValid(table.Version()) { + table.SetVersion(versionSDK.Current()) } } diff --git a/cmd/neofs-cli/modules/util.go b/cmd/neofs-cli/modules/util.go index 0e83f2a9fb..c9c730eff5 100644 --- a/cmd/neofs-cli/modules/util.go +++ b/cmd/neofs-cli/modules/util.go @@ -10,6 +10,7 @@ import ( "strconv" "time" + "github.com/nspcc-dev/neofs-api-go/v2/refs" "github.com/nspcc-dev/neofs-node/pkg/util/keyer" locodedb "github.com/nspcc-dev/neofs-node/pkg/util/locode/db" airportsdb "github.com/nspcc-dev/neofs-node/pkg/util/locode/db/airports" @@ -427,7 +428,11 @@ func completeBearerToken(btok *token.BearerToken) error { if v2 := btok.ToV2(); v2 != nil { // set eACL table version, because it usually omitted table := v2.GetBody().GetEACL() - table.SetVersion(version.Current().ToV2()) + + var ver refs.Version + version.Current().WriteToV2(&ver) + + table.SetVersion(&ver) } else { return errors.New("unsupported bearer token version") } diff --git a/cmd/neofs-node/config.go b/cmd/neofs-node/config.go index 6c2bb5ecb4..904914ff33 100644 --- a/cmd/neofs-node/config.go +++ b/cmd/neofs-node/config.go @@ -79,7 +79,7 @@ type cfg struct { ownerIDFromKey *owner.ID // owner ID calculated from key - apiVersion *version.Version + apiVersion version.Version cfgGRPC cfgGRPC diff --git a/go.mod b/go.mod index cb7624f867..a27e6b32e6 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220321144137-d5a9af5860af // indirect github.com/nspcc-dev/neofs-api-go/v2 v2.12.1 github.com/nspcc-dev/neofs-contract v0.14.2 - github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.3.0.20220412151250-3e75660802ae + github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.3.0.20220413072812-c961aea14446 github.com/nspcc-dev/tzhash v1.5.2 github.com/panjf2000/ants/v2 v2.4.0 github.com/paulmach/orb v0.2.2 diff --git a/go.sum b/go.sum index 4c848684db757452c51a63438e488ff85bbe80d4..9f2816c52b9e3baec65b30867f6df5d2803ef08c 100644 GIT binary patch delta 115 zcmbR6k9ER7)(x4nosA95jVug}bdxR33=>lm4NXi;%oH*Vt(+{9LYxYt%3Qp>y;F;| z!;PKwlM{=~gB*j>9ZSo6qx>q2%?zuYBLZBqCvTi6KG}a3-{jEQA|lw#+x&C3_+tQr CP$kO% delta 115 zcmbR6k9ER7)(x4nosA4l4UJ3