[#1400] owner: Upgrade SDK package

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-05-17 16:59:46 +03:00 committed by LeL
parent f8ac4632f8
commit bb25ecbd15
60 changed files with 379 additions and 327 deletions

View file

@ -6,7 +6,6 @@ import (
"github.com/nspcc-dev/neofs-node/pkg/core/version"
"github.com/nspcc-dev/neofs-sdk-go/container"
"github.com/nspcc-dev/neofs-sdk-go/owner"
)
var (
@ -28,8 +27,8 @@ func CheckFormat(c *container.Container) error {
return fmt.Errorf("incorrect version %s", v)
}
if ln := len(c.OwnerID().ToV2().GetValue()); ln != owner.NEO3WalletSize {
return fmt.Errorf("incorrect owner identifier: expected length %d != %d", owner.NEO3WalletSize, ln)
if c.OwnerID() == nil {
return errors.New("missing owner")
}
if _, err := c.NonceUUID(); err != nil {

View file

@ -7,7 +7,7 @@ import (
"github.com/nspcc-dev/neofs-node/pkg/util/test"
"github.com/nspcc-dev/neofs-sdk-go/container"
"github.com/nspcc-dev/neofs-sdk-go/netmap"
"github.com/nspcc-dev/neofs-sdk-go/owner"
"github.com/nspcc-dev/neofs-sdk-go/user"
"github.com/nspcc-dev/neofs-sdk-go/version"
"github.com/stretchr/testify/require"
)
@ -27,9 +27,10 @@ func TestCheckFormat(t *testing.T) {
require.Error(t, CheckFormat(c))
oid := owner.NewIDFromPublicKey(&test.DecodeKey(-1).PublicKey)
var oid user.ID
user.IDFromKey(&oid, test.DecodeKey(-1).PublicKey)
c.SetOwnerID(oid)
c.SetOwnerID(&oid)
// set incorrect nonce
cV2 := c.ToV2()