[#1214] *: Use single Object
type in whole project
Remove `Object` and `RawObject` types from `pkg/core/object` package. Use `Object` type from NeoFS SDK Go library everywhere. Avoid using the deprecated elements. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
19ad349b27
commit
7ccd1625af
100 changed files with 847 additions and 965 deletions
|
@ -6,7 +6,7 @@ import (
|
|||
|
||||
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/shard"
|
||||
cidtest "github.com/nspcc-dev/neofs-sdk-go/container/id/test"
|
||||
objectSDK "github.com/nspcc-dev/neofs-sdk-go/object"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/object"
|
||||
addressSDK "github.com/nspcc-dev/neofs-sdk-go/object/address"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
@ -15,22 +15,22 @@ func TestHeadRaw(t *testing.T) {
|
|||
defer os.RemoveAll(t.Name())
|
||||
|
||||
cid := cidtest.ID()
|
||||
splitID := objectSDK.NewSplitID()
|
||||
splitID := object.NewSplitID()
|
||||
|
||||
parent := generateRawObjectWithCID(t, cid)
|
||||
parent := generateObjectWithCID(t, cid)
|
||||
addAttribute(parent, "foo", "bar")
|
||||
|
||||
parentAddr := addressSDK.NewAddress()
|
||||
parentAddr.SetContainerID(cid)
|
||||
parentAddr.SetObjectID(parent.ID())
|
||||
|
||||
child := generateRawObjectWithCID(t, cid)
|
||||
child.SetParent(parent.Object().SDK())
|
||||
child := generateObjectWithCID(t, cid)
|
||||
child.SetParent(parent)
|
||||
child.SetParentID(parent.ID())
|
||||
child.SetSplitID(splitID)
|
||||
|
||||
link := generateRawObjectWithCID(t, cid)
|
||||
link.SetParent(parent.Object().SDK())
|
||||
link := generateObjectWithCID(t, cid)
|
||||
link.SetParent(parent)
|
||||
link.SetParentID(parent.ID())
|
||||
link.SetChildren(child.ID())
|
||||
link.SetSplitID(splitID)
|
||||
|
@ -42,8 +42,8 @@ func TestHeadRaw(t *testing.T) {
|
|||
e := testNewEngineWithShards(s1, s2)
|
||||
defer e.Close()
|
||||
|
||||
putPrmLeft := new(shard.PutPrm).WithObject(child.Object())
|
||||
putPrmLink := new(shard.PutPrm).WithObject(link.Object())
|
||||
putPrmLeft := new(shard.PutPrm).WithObject(child)
|
||||
putPrmLink := new(shard.PutPrm).WithObject(link)
|
||||
|
||||
// put most left object in one shard
|
||||
_, err := s1.Put(putPrmLeft)
|
||||
|
@ -58,7 +58,7 @@ func TestHeadRaw(t *testing.T) {
|
|||
_, err = e.Head(headPrm)
|
||||
require.Error(t, err)
|
||||
|
||||
si, ok := err.(*objectSDK.SplitInfoError)
|
||||
si, ok := err.(*object.SplitInfoError)
|
||||
require.True(t, ok)
|
||||
|
||||
// SplitInfoError should contain info from both shards
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue