[#1181] Do not use deprecated elements

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-03-05 11:49:19 +03:00 committed by LeL
parent e3f4e48d87
commit 323dea95c6
6 changed files with 10 additions and 10 deletions

View file

@ -41,7 +41,7 @@ var cmdObjectLock = &cobra.Command{
var lock object.Lock
lock.WriteMembers(lockList)
obj := object.NewRaw()
obj := object.New()
obj.SetContainerID(&cnr)
obj.SetOwnerID(idOwner)
obj.SetType(object.TypeLock)
@ -51,7 +51,7 @@ var cmdObjectLock = &cobra.Command{
prepareSessionPrmWithOwner(cmd, objectcore.AddressOf(obj), key, idOwner, &prm)
prepareObjectPrm(cmd, &prm)
prm.SetHeader(obj.Object())
prm.SetHeader(obj)
_, err = internalclient.PutObject(prm)
exitOnErr(cmd, errf("Store lock object in NeoFS: %w", err))

View file

@ -57,7 +57,7 @@ func benchmarkExists(b *testing.B, shardNum int) {
addr := objecttest.Address()
for i := 0; i < 100; i++ {
obj := generateObjectWithCID(b, cidtest.ID())
err := Put(e, obj.Object())
err := Put(e, obj)
if err != nil {
b.Fatal(err)
}
@ -133,7 +133,7 @@ func testOID() *oidSDK.ID {
return id
}
func generateObjectWithCID(t testing.TB, cid *cid.ID) *object.RawObject {
func generateObjectWithCID(t testing.TB, cid *cid.ID) *object.Object {
version := version.New()
version.SetMajor(2)
version.SetMinor(1)

View file

@ -143,12 +143,12 @@ func TestBlobstorFailback(t *testing.T) {
obj := generateObjectWithCID(t, cidtest.ID())
obj.SetPayload(make([]byte, size))
prm := new(shard.PutPrm).WithObject(obj.Object())
prm := new(shard.PutPrm).WithObject(obj)
e.mtx.RLock()
_, err = e.shards[id[0].String()].Shard.Put(prm)
e.mtx.RUnlock()
require.NoError(t, err)
objs = append(objs, obj.Object())
objs = append(objs, obj)
}
for i := range objs {

View file

@ -62,12 +62,12 @@ func TestDB_Get(t *testing.T) {
raw.SetType(objectSDK.TypeLock)
raw.SetID(testOID())
err := putBig(db, raw.Object())
err := putBig(db, raw)
require.NoError(t, err)
newObj, err := meta.Get(db, object.AddressOf(raw))
require.NoError(t, err)
require.Equal(t, raw.CutPayload().Object(), newObj)
require.Equal(t, raw.CutPayload(), newObj)
})
t.Run("put virtual object", func(t *testing.T) {

View file

@ -29,7 +29,7 @@ func TestDB_Lock(t *testing.T) {
object.TypeLock,
object.TypeRegular,
} {
obj := objecttest.Raw()
obj := objecttest.Object()
obj.SetType(typ)
obj.SetContainerID(&cnr)

View file

@ -24,7 +24,7 @@ func TestOriginalTokens(t *testing.T) {
}
}
func testGenerateMetaHeader(depth uint32, b *acl.BearerToken, s *session.SessionToken) *session.RequestMetaHeader {
func testGenerateMetaHeader(depth uint32, b *acl.BearerToken, s *session.Token) *session.RequestMetaHeader {
metaHeader := new(session.RequestMetaHeader)
metaHeader.SetBearerToken(b)
metaHeader.SetSessionToken(s)