forked from TrueCloudLab/frostfs-node
[#1454] Upgrade NeoFS SDK Go module with new IDs
Core changes: * avoid package-colliding variable naming * avoid using pointers to IDs where unnecessary * avoid using `idSDK` import alias pattern * use `EncodeToString` for protocol string calculation and `String` for printing Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
cc6209e8a0
commit
1c30414a6c
218 changed files with 2095 additions and 2521 deletions
|
@ -8,7 +8,6 @@ import (
|
|||
apistatus "github.com/nspcc-dev/neofs-sdk-go/client/status"
|
||||
cidtest "github.com/nspcc-dev/neofs-sdk-go/container/id/test"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/object"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/object/address"
|
||||
oid "github.com/nspcc-dev/neofs-sdk-go/object/id"
|
||||
oidtest "github.com/nspcc-dev/neofs-sdk-go/object/id/test"
|
||||
objecttest "github.com/nspcc-dev/neofs-sdk-go/object/test"
|
||||
|
@ -71,20 +70,20 @@ func TestDB_Lock(t *testing.T) {
|
|||
err = db.Lock(cnr, tombID, []oid.ID{id})
|
||||
require.NoError(t, err)
|
||||
|
||||
var tombAddr address.Address
|
||||
tombAddr.SetContainerID(cnr)
|
||||
tombAddr.SetObjectID(tombID)
|
||||
var tombAddr oid.Address
|
||||
tombAddr.SetContainer(cnr)
|
||||
tombAddr.SetObject(tombID)
|
||||
|
||||
// try to inhume locked object using tombstone
|
||||
err = meta.Inhume(db, objectcore.AddressOf(obj), &tombAddr)
|
||||
err = meta.Inhume(db, objectcore.AddressOf(obj), tombAddr)
|
||||
require.ErrorAs(t, err, new(apistatus.ObjectLocked))
|
||||
|
||||
// inhume the tombstone
|
||||
_, err = db.Inhume(new(meta.InhumePrm).WithAddresses(&tombAddr).WithGCMark())
|
||||
_, err = db.Inhume(new(meta.InhumePrm).WithAddresses(tombAddr).WithGCMark())
|
||||
require.NoError(t, err)
|
||||
|
||||
// now we can inhume the object
|
||||
err = meta.Inhume(db, objectcore.AddressOf(obj), &tombAddr)
|
||||
err = meta.Inhume(db, objectcore.AddressOf(obj), tombAddr)
|
||||
require.NoError(t, err)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue