forked from TrueCloudLab/frostfs-node
[#1181] Do not use deprecated elements
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
e3f4e48d87
commit
323dea95c6
6 changed files with 10 additions and 10 deletions
|
@ -41,7 +41,7 @@ var cmdObjectLock = &cobra.Command{
|
||||||
var lock object.Lock
|
var lock object.Lock
|
||||||
lock.WriteMembers(lockList)
|
lock.WriteMembers(lockList)
|
||||||
|
|
||||||
obj := object.NewRaw()
|
obj := object.New()
|
||||||
obj.SetContainerID(&cnr)
|
obj.SetContainerID(&cnr)
|
||||||
obj.SetOwnerID(idOwner)
|
obj.SetOwnerID(idOwner)
|
||||||
obj.SetType(object.TypeLock)
|
obj.SetType(object.TypeLock)
|
||||||
|
@ -51,7 +51,7 @@ var cmdObjectLock = &cobra.Command{
|
||||||
|
|
||||||
prepareSessionPrmWithOwner(cmd, objectcore.AddressOf(obj), key, idOwner, &prm)
|
prepareSessionPrmWithOwner(cmd, objectcore.AddressOf(obj), key, idOwner, &prm)
|
||||||
prepareObjectPrm(cmd, &prm)
|
prepareObjectPrm(cmd, &prm)
|
||||||
prm.SetHeader(obj.Object())
|
prm.SetHeader(obj)
|
||||||
|
|
||||||
_, err = internalclient.PutObject(prm)
|
_, err = internalclient.PutObject(prm)
|
||||||
exitOnErr(cmd, errf("Store lock object in NeoFS: %w", err))
|
exitOnErr(cmd, errf("Store lock object in NeoFS: %w", err))
|
||||||
|
|
|
@ -57,7 +57,7 @@ func benchmarkExists(b *testing.B, shardNum int) {
|
||||||
addr := objecttest.Address()
|
addr := objecttest.Address()
|
||||||
for i := 0; i < 100; i++ {
|
for i := 0; i < 100; i++ {
|
||||||
obj := generateObjectWithCID(b, cidtest.ID())
|
obj := generateObjectWithCID(b, cidtest.ID())
|
||||||
err := Put(e, obj.Object())
|
err := Put(e, obj)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
b.Fatal(err)
|
b.Fatal(err)
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,7 @@ func testOID() *oidSDK.ID {
|
||||||
return 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 := version.New()
|
||||||
version.SetMajor(2)
|
version.SetMajor(2)
|
||||||
version.SetMinor(1)
|
version.SetMinor(1)
|
||||||
|
|
|
@ -143,12 +143,12 @@ func TestBlobstorFailback(t *testing.T) {
|
||||||
obj := generateObjectWithCID(t, cidtest.ID())
|
obj := generateObjectWithCID(t, cidtest.ID())
|
||||||
obj.SetPayload(make([]byte, size))
|
obj.SetPayload(make([]byte, size))
|
||||||
|
|
||||||
prm := new(shard.PutPrm).WithObject(obj.Object())
|
prm := new(shard.PutPrm).WithObject(obj)
|
||||||
e.mtx.RLock()
|
e.mtx.RLock()
|
||||||
_, err = e.shards[id[0].String()].Shard.Put(prm)
|
_, err = e.shards[id[0].String()].Shard.Put(prm)
|
||||||
e.mtx.RUnlock()
|
e.mtx.RUnlock()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
objs = append(objs, obj.Object())
|
objs = append(objs, obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := range objs {
|
for i := range objs {
|
||||||
|
|
|
@ -62,12 +62,12 @@ func TestDB_Get(t *testing.T) {
|
||||||
raw.SetType(objectSDK.TypeLock)
|
raw.SetType(objectSDK.TypeLock)
|
||||||
raw.SetID(testOID())
|
raw.SetID(testOID())
|
||||||
|
|
||||||
err := putBig(db, raw.Object())
|
err := putBig(db, raw)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
newObj, err := meta.Get(db, object.AddressOf(raw))
|
newObj, err := meta.Get(db, object.AddressOf(raw))
|
||||||
require.NoError(t, err)
|
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) {
|
t.Run("put virtual object", func(t *testing.T) {
|
||||||
|
|
|
@ -29,7 +29,7 @@ func TestDB_Lock(t *testing.T) {
|
||||||
object.TypeLock,
|
object.TypeLock,
|
||||||
object.TypeRegular,
|
object.TypeRegular,
|
||||||
} {
|
} {
|
||||||
obj := objecttest.Raw()
|
obj := objecttest.Object()
|
||||||
obj.SetType(typ)
|
obj.SetType(typ)
|
||||||
obj.SetContainerID(&cnr)
|
obj.SetContainerID(&cnr)
|
||||||
|
|
||||||
|
|
|
@ -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 := new(session.RequestMetaHeader)
|
||||||
metaHeader.SetBearerToken(b)
|
metaHeader.SetBearerToken(b)
|
||||||
metaHeader.SetSessionToken(s)
|
metaHeader.SetSessionToken(s)
|
||||||
|
|
Loading…
Reference in a new issue