[#1369] version: Upgrade SDK package

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-05-11 17:58:52 +03:00 committed by LeL
parent 7a57d7b076
commit 088df0e2a9
13 changed files with 60 additions and 38 deletions

View file

@ -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())
}
}

View file

@ -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")
}