forked from TrueCloudLab/frostfs-node
[#570] *: Remove usage of deprecated elements from API Go library
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
70a7354e9d
commit
3dd10b6795
63 changed files with 285 additions and 270 deletions
|
@ -7,7 +7,7 @@ import (
|
|||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/nspcc-dev/neofs-api-go/pkg/container"
|
||||
cid "github.com/nspcc-dev/neofs-api-go/pkg/container/id"
|
||||
objectSDK "github.com/nspcc-dev/neofs-api-go/pkg/object"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/core/object"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/util/logger/test"
|
||||
|
@ -21,15 +21,15 @@ func testSHA256() (h [sha256.Size]byte) {
|
|||
}
|
||||
|
||||
func testAddress() *objectSDK.Address {
|
||||
cid := container.NewID()
|
||||
cid.SetSHA256(testSHA256())
|
||||
id := cid.New()
|
||||
id.SetSHA256(testSHA256())
|
||||
|
||||
oid := objectSDK.NewID()
|
||||
oid.SetSHA256(testSHA256())
|
||||
|
||||
addr := objectSDK.NewAddress()
|
||||
addr.SetObjectID(oid)
|
||||
addr.SetContainerID(cid)
|
||||
addr.SetContainerID(id)
|
||||
|
||||
return addr
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
"path"
|
||||
"strings"
|
||||
|
||||
"github.com/nspcc-dev/neofs-api-go/pkg/container"
|
||||
cid "github.com/nspcc-dev/neofs-api-go/pkg/container/id"
|
||||
objectSDK "github.com/nspcc-dev/neofs-api-go/pkg/object"
|
||||
)
|
||||
|
||||
|
@ -54,14 +54,14 @@ func addressFromString(s string) (*objectSDK.Address, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
cid := container.NewID()
|
||||
if err := cid.Parse(ss[1]); err != nil {
|
||||
id := cid.New()
|
||||
if err := id.Parse(ss[1]); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
addr := objectSDK.NewAddress()
|
||||
addr.SetObjectID(oid)
|
||||
addr.SetContainerID(cid)
|
||||
addr.SetContainerID(id)
|
||||
|
||||
return addr, nil
|
||||
}
|
||||
|
|
|
@ -8,16 +8,16 @@ import (
|
|||
"path"
|
||||
"testing"
|
||||
|
||||
"github.com/nspcc-dev/neofs-api-go/pkg/container"
|
||||
cid "github.com/nspcc-dev/neofs-api-go/pkg/container/id"
|
||||
objectSDK "github.com/nspcc-dev/neofs-api-go/pkg/object"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func testCID() *container.ID {
|
||||
func testCID() *cid.ID {
|
||||
cs := [sha256.Size]byte{}
|
||||
_, _ = rand.Read(cs[:])
|
||||
|
||||
id := container.NewID()
|
||||
id := cid.New()
|
||||
id.SetSHA256(cs)
|
||||
|
||||
return id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue