[#979] Upgrade SDK NeoFS Go dependency
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
3fcd7bc948
commit
6f41cd86ed
33 changed files with 53 additions and 53 deletions
4
go.mod
4
go.mod
|
@ -12,8 +12,8 @@ require (
|
|||
github.com/multiformats/go-multiaddr v0.4.0
|
||||
github.com/nspcc-dev/hrw v1.0.9
|
||||
github.com/nspcc-dev/neo-go v0.97.4-pre.0.20211126130906-87f5113c031b
|
||||
github.com/nspcc-dev/neofs-api-go/v2 v2.11.0-pre.0.20211124141318-d93828f46514
|
||||
github.com/nspcc-dev/neofs-sdk-go v0.0.0-20211126125208-279a5a1e0bfe
|
||||
github.com/nspcc-dev/neofs-api-go/v2 v2.11.0-pre.0.20211201134523-3604d96f3fe1
|
||||
github.com/nspcc-dev/neofs-sdk-go v0.0.0-20211201135501-471ed5a3ec0b
|
||||
github.com/nspcc-dev/tzhash v1.4.0
|
||||
github.com/panjf2000/ants/v2 v2.4.0
|
||||
github.com/paulmach/orb v0.2.2
|
||||
|
|
BIN
go.sum
BIN
go.sum
Binary file not shown.
|
@ -42,7 +42,7 @@ func blankValidObject(t *testing.T, key *ecdsa.PrivateKey) *RawObject {
|
|||
ownerID.SetNeo3Wallet(wallet)
|
||||
|
||||
obj := NewRaw()
|
||||
obj.SetContainerID(cidtest.GenerateID())
|
||||
obj.SetContainerID(cidtest.ID())
|
||||
obj.SetOwnerID(ownerID)
|
||||
|
||||
return obj
|
||||
|
@ -87,7 +87,7 @@ func TestFormatValidator_Validate(t *testing.T) {
|
|||
|
||||
t.Run("unsigned object", func(t *testing.T) {
|
||||
obj := NewRaw()
|
||||
obj.SetContainerID(cidtest.GenerateID())
|
||||
obj.SetContainerID(cidtest.ID())
|
||||
obj.SetID(testObjectID(t))
|
||||
|
||||
require.Error(t, v.Validate(obj.Object()))
|
||||
|
@ -97,12 +97,12 @@ func TestFormatValidator_Validate(t *testing.T) {
|
|||
w, err := owner.NEO3WalletFromPublicKey((*ecdsa.PublicKey)(ownerKey.PublicKey()))
|
||||
require.NoError(t, err)
|
||||
|
||||
tok := sessiontest.Generate()
|
||||
tok := sessiontest.Token()
|
||||
tok.SetOwnerID(owner.NewIDFromNeo3Wallet(w))
|
||||
|
||||
obj := NewRaw()
|
||||
obj.SetContainerID(cidtest.GenerateID())
|
||||
obj.SetSessionToken(sessiontest.Generate())
|
||||
obj.SetContainerID(cidtest.ID())
|
||||
obj.SetSessionToken(sessiontest.Token())
|
||||
obj.SetOwnerID(tok.OwnerID())
|
||||
|
||||
require.NoError(t, object.SetIDWithSignature(&ownerKey.PrivateKey, obj.SDK()))
|
||||
|
|
|
@ -79,7 +79,7 @@ func generateContainers(n int) []*cid.ID {
|
|||
result := make([]*cid.ID, 0, n)
|
||||
|
||||
for i := 0; i < n; i++ {
|
||||
result = append(result, cidtest.GenerateID())
|
||||
result = append(result, cidtest.ID())
|
||||
}
|
||||
|
||||
return result
|
||||
|
|
|
@ -101,7 +101,7 @@ func TestPutValidator_Assert(t *testing.T) {
|
|||
// diff explicit creator and the one in info
|
||||
var creator2 owner.ID
|
||||
|
||||
creator2 = *ownertest.GenerateID()
|
||||
creator2 = *ownertest.ID()
|
||||
|
||||
e.info.SetOwner(creator2)
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ func testAddress() *objectSDK.Address {
|
|||
|
||||
addr := objectSDK.NewAddress()
|
||||
addr.SetObjectID(oid)
|
||||
addr.SetContainerID(cidtest.GenerateID())
|
||||
addr.SetContainerID(cidtest.ID())
|
||||
|
||||
return addr
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ func testAddress() *objectSDK.Address {
|
|||
|
||||
addr := objectSDK.NewAddress()
|
||||
addr.SetObjectID(oid)
|
||||
addr.SetContainerID(cidtest.GenerateID())
|
||||
addr.SetContainerID(cidtest.ID())
|
||||
|
||||
return addr
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ func testOID() *objectSDK.ID {
|
|||
func testAddress() *objectSDK.Address {
|
||||
a := objectSDK.NewAddress()
|
||||
a.SetObjectID(testOID())
|
||||
a.SetContainerID(cidtest.GenerateID())
|
||||
a.SetContainerID(cidtest.ID())
|
||||
|
||||
return a
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ func TestExecBlocks(t *testing.T) {
|
|||
})
|
||||
|
||||
// put some object
|
||||
obj := generateRawObjectWithCID(t, cidtest.GenerateID()).Object()
|
||||
obj := generateRawObjectWithCID(t, cidtest.ID()).Object()
|
||||
|
||||
addr := obj.Address()
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ func generateRawObjectWithCID(t *testing.T, cid *cid.ID) *object.RawObject {
|
|||
|
||||
obj := object.NewRaw()
|
||||
obj.SetID(testOID())
|
||||
obj.SetOwnerID(ownertest.GenerateID())
|
||||
obj.SetOwnerID(ownertest.ID())
|
||||
obj.SetContainerID(cid)
|
||||
obj.SetVersion(version)
|
||||
obj.SetPayloadChecksum(csum)
|
||||
|
|
|
@ -13,7 +13,7 @@ import (
|
|||
func TestHeadRaw(t *testing.T) {
|
||||
defer os.RemoveAll(t.Name())
|
||||
|
||||
cid := cidtest.GenerateID()
|
||||
cid := cidtest.ID()
|
||||
splitID := objectSDK.NewSplitID()
|
||||
|
||||
parent := generateRawObjectWithCID(t, cid)
|
||||
|
|
|
@ -13,7 +13,7 @@ import (
|
|||
func TestStorageEngine_Inhume(t *testing.T) {
|
||||
defer os.RemoveAll(t.Name())
|
||||
|
||||
cid := cidtest.GenerateID()
|
||||
cid := cidtest.ID()
|
||||
splitID := objectSDK.NewSplitID()
|
||||
|
||||
fs := objectSDK.SearchFilters{}
|
||||
|
|
|
@ -27,7 +27,7 @@ func TestListWithCursor(t *testing.T) {
|
|||
got := make([]*object.Address, 0, total)
|
||||
|
||||
for i := 0; i < total; i++ {
|
||||
containerID := cidtest.GenerateID()
|
||||
containerID := cidtest.ID()
|
||||
obj := generateRawObjectWithCID(t, containerID)
|
||||
prm := new(PutPrm).WithObject(obj.Object())
|
||||
_, err := e.Put(prm)
|
||||
|
|
|
@ -127,7 +127,7 @@ func TestDB_ContainerSize(t *testing.T) {
|
|||
objs := make(map[*cid.ID][]*object.RawObject, C*N)
|
||||
|
||||
for i := 0; i < C; i++ {
|
||||
cid := cidtest.GenerateID()
|
||||
cid := cidtest.ID()
|
||||
cids[cid] = 0
|
||||
|
||||
for j := 0; j < N; j++ {
|
||||
|
|
|
@ -61,7 +61,7 @@ func newDB(t testing.TB) *meta.DB {
|
|||
}
|
||||
|
||||
func generateRawObject(t *testing.T) *object.RawObject {
|
||||
return generateRawObjectWithCID(t, cidtest.GenerateID())
|
||||
return generateRawObjectWithCID(t, cidtest.ID())
|
||||
}
|
||||
|
||||
func generateRawObjectWithCID(t *testing.T, cid *cid.ID) *object.RawObject {
|
||||
|
@ -80,7 +80,7 @@ func generateRawObjectWithCID(t *testing.T, cid *cid.ID) *object.RawObject {
|
|||
|
||||
obj := object.NewRaw()
|
||||
obj.SetID(testOID())
|
||||
obj.SetOwnerID(ownertest.GenerateID())
|
||||
obj.SetOwnerID(ownertest.ID())
|
||||
obj.SetContainerID(cid)
|
||||
obj.SetVersion(version)
|
||||
obj.SetPayloadChecksum(csum)
|
||||
|
@ -92,7 +92,7 @@ func generateRawObjectWithCID(t *testing.T, cid *cid.ID) *object.RawObject {
|
|||
|
||||
func generateAddress() *objectSDK.Address {
|
||||
addr := objectSDK.NewAddress()
|
||||
addr.SetContainerID(cidtest.GenerateID())
|
||||
addr.SetContainerID(cidtest.ID())
|
||||
addr.SetObjectID(testOID())
|
||||
|
||||
return addr
|
||||
|
|
|
@ -13,7 +13,7 @@ import (
|
|||
func TestDB_Delete(t *testing.T) {
|
||||
db := newDB(t)
|
||||
|
||||
cid := cidtest.GenerateID()
|
||||
cid := cidtest.ID()
|
||||
parent := generateRawObjectWithCID(t, cid)
|
||||
addAttribute(parent, "foo", "bar")
|
||||
|
||||
|
@ -69,7 +69,7 @@ func TestDB_Delete(t *testing.T) {
|
|||
func TestDeleteAllChildren(t *testing.T) {
|
||||
db := newDB(t)
|
||||
|
||||
cid := cidtest.GenerateID()
|
||||
cid := cidtest.ID()
|
||||
|
||||
// generate parent object
|
||||
parent := generateRawObjectWithCID(t, cid)
|
||||
|
|
|
@ -55,7 +55,7 @@ func TestDB_Exists(t *testing.T) {
|
|||
})
|
||||
|
||||
t.Run("virtual object", func(t *testing.T) {
|
||||
cid := cidtest.GenerateID()
|
||||
cid := cidtest.ID()
|
||||
parent := generateRawObjectWithCID(t, cid)
|
||||
|
||||
child := generateRawObjectWithCID(t, cid)
|
||||
|
@ -72,7 +72,7 @@ func TestDB_Exists(t *testing.T) {
|
|||
})
|
||||
|
||||
t.Run("merge split info", func(t *testing.T) {
|
||||
cid := cidtest.GenerateID()
|
||||
cid := cidtest.ID()
|
||||
splitID := objectSDK.NewSplitID()
|
||||
|
||||
parent := generateRawObjectWithCID(t, cid)
|
||||
|
|
|
@ -59,7 +59,7 @@ func TestDB_Get(t *testing.T) {
|
|||
})
|
||||
|
||||
t.Run("put virtual object", func(t *testing.T) {
|
||||
cid := cidtest.GenerateID()
|
||||
cid := cidtest.ID()
|
||||
splitID := objectSDK.NewSplitID()
|
||||
|
||||
parent := generateRawObjectWithCID(t, cid)
|
||||
|
|
|
@ -23,7 +23,7 @@ func TestLisObjectsWithCursor(t *testing.T) {
|
|||
|
||||
// fill metabase with objects
|
||||
for i := 0; i < containers; i++ {
|
||||
containerID := cidtest.GenerateID()
|
||||
containerID := cidtest.ID()
|
||||
|
||||
// add one regular object
|
||||
obj := generateRawObjectWithCID(t, containerID)
|
||||
|
|
|
@ -15,7 +15,7 @@ import (
|
|||
func TestDB_SelectUserAttributes(t *testing.T) {
|
||||
db := newDB(t)
|
||||
|
||||
cid := cidtest.GenerateID()
|
||||
cid := cidtest.ID()
|
||||
|
||||
raw1 := generateRawObjectWithCID(t, cid)
|
||||
addAttribute(raw1, "foo", "bar")
|
||||
|
@ -137,7 +137,7 @@ func TestDB_SelectUserAttributes(t *testing.T) {
|
|||
func TestDB_SelectRootPhyParent(t *testing.T) {
|
||||
db := newDB(t)
|
||||
|
||||
cid := cidtest.GenerateID()
|
||||
cid := cidtest.ID()
|
||||
|
||||
// prepare
|
||||
|
||||
|
@ -304,7 +304,7 @@ func TestDB_SelectRootPhyParent(t *testing.T) {
|
|||
func TestDB_SelectInhume(t *testing.T) {
|
||||
db := newDB(t)
|
||||
|
||||
cid := cidtest.GenerateID()
|
||||
cid := cidtest.ID()
|
||||
|
||||
raw1 := generateRawObjectWithCID(t, cid)
|
||||
err := putBig(db, raw1.Object())
|
||||
|
@ -336,7 +336,7 @@ func TestDB_SelectInhume(t *testing.T) {
|
|||
func TestDB_SelectPayloadHash(t *testing.T) {
|
||||
db := newDB(t)
|
||||
|
||||
cid := cidtest.GenerateID()
|
||||
cid := cidtest.ID()
|
||||
|
||||
raw1 := generateRawObjectWithCID(t, cid)
|
||||
err := putBig(db, raw1.Object())
|
||||
|
@ -371,7 +371,7 @@ func TestDB_SelectPayloadHash(t *testing.T) {
|
|||
func TestDB_SelectWithSlowFilters(t *testing.T) {
|
||||
db := newDB(t)
|
||||
|
||||
cid := cidtest.GenerateID()
|
||||
cid := cidtest.ID()
|
||||
|
||||
v20 := new(version.Version)
|
||||
v20.SetMajor(2)
|
||||
|
@ -469,7 +469,7 @@ func TestDB_SelectWithSlowFilters(t *testing.T) {
|
|||
func TestDB_SelectObjectID(t *testing.T) {
|
||||
db := newDB(t)
|
||||
|
||||
cid := cidtest.GenerateID()
|
||||
cid := cidtest.ID()
|
||||
|
||||
// prepare
|
||||
|
||||
|
@ -577,7 +577,7 @@ func TestDB_SelectObjectID(t *testing.T) {
|
|||
func TestDB_SelectSplitID(t *testing.T) {
|
||||
db := newDB(t)
|
||||
|
||||
cid := cidtest.GenerateID()
|
||||
cid := cidtest.ID()
|
||||
|
||||
child1 := generateRawObjectWithCID(t, cid)
|
||||
child2 := generateRawObjectWithCID(t, cid)
|
||||
|
@ -631,7 +631,7 @@ func TestDB_SelectSplitID(t *testing.T) {
|
|||
func TestDB_SelectContainerID(t *testing.T) {
|
||||
db := newDB(t)
|
||||
|
||||
cid := cidtest.GenerateID()
|
||||
cid := cidtest.ID()
|
||||
|
||||
obj1 := generateRawObjectWithCID(t, cid)
|
||||
err := putBig(db, obj1.Object())
|
||||
|
@ -665,7 +665,7 @@ func TestDB_SelectContainerID(t *testing.T) {
|
|||
})
|
||||
|
||||
t.Run("not same cid", func(t *testing.T) {
|
||||
newCID := cidtest.GenerateID()
|
||||
newCID := cidtest.ID()
|
||||
|
||||
fs := objectSDK.SearchFilters{}
|
||||
fs.AddObjectContainerIDFilter(objectSDK.MatchStringEqual, newCID)
|
||||
|
|
|
@ -23,7 +23,7 @@ func testShardDelete(t *testing.T, hasWriteCache bool) {
|
|||
sh := newShard(t, hasWriteCache)
|
||||
defer releaseShard(sh, t)
|
||||
|
||||
cid := cidtest.GenerateID()
|
||||
cid := cidtest.ID()
|
||||
|
||||
obj := generateRawObjectWithCID(t, cid)
|
||||
addAttribute(obj, "foo", "bar")
|
||||
|
|
|
@ -68,7 +68,7 @@ func testShardGet(t *testing.T, hasWriteCache bool) {
|
|||
t.Run("parent object", func(t *testing.T) {
|
||||
obj := generateRawObject(t)
|
||||
addAttribute(obj, "foo", "bar")
|
||||
cid := cidtest.GenerateID()
|
||||
cid := cidtest.ID()
|
||||
splitID := objectSDK.NewSplitID()
|
||||
|
||||
parent := generateRawObjectWithCID(t, cid)
|
||||
|
|
|
@ -46,7 +46,7 @@ func testShardHead(t *testing.T, hasWriteCache bool) {
|
|||
})
|
||||
|
||||
t.Run("virtual object", func(t *testing.T) {
|
||||
cid := cidtest.GenerateID()
|
||||
cid := cidtest.ID()
|
||||
splitID := objectSDK.NewSplitID()
|
||||
|
||||
parent := generateRawObjectWithCID(t, cid)
|
||||
|
|
|
@ -23,7 +23,7 @@ func testShardInhume(t *testing.T, hasWriteCache bool) {
|
|||
sh := newShard(t, hasWriteCache)
|
||||
defer releaseShard(sh, t)
|
||||
|
||||
cid := cidtest.GenerateID()
|
||||
cid := cidtest.ID()
|
||||
|
||||
obj := generateRawObjectWithCID(t, cid)
|
||||
addAttribute(obj, "foo", "bar")
|
||||
|
|
|
@ -34,7 +34,7 @@ func testShardList(t *testing.T, sh *shard.Shard) {
|
|||
putPrm := new(shard.PutPrm)
|
||||
|
||||
for i := 0; i < C; i++ {
|
||||
cid := cidtest.GenerateID()
|
||||
cid := cidtest.ID()
|
||||
|
||||
for j := 0; j < N; j++ {
|
||||
obj := generateRawObjectWithCID(t, cid)
|
||||
|
|
|
@ -65,7 +65,7 @@ func releaseShard(s *shard.Shard, t testing.TB) {
|
|||
}
|
||||
|
||||
func generateRawObject(t *testing.T) *object.RawObject {
|
||||
return generateRawObjectWithCID(t, cidtest.GenerateID())
|
||||
return generateRawObjectWithCID(t, cidtest.ID())
|
||||
}
|
||||
|
||||
func generateRawObjectWithCID(t *testing.T, cid *cid.ID) *object.RawObject {
|
||||
|
@ -84,7 +84,7 @@ func generateRawObjectWithCID(t *testing.T, cid *cid.ID) *object.RawObject {
|
|||
|
||||
obj := object.NewRaw()
|
||||
obj.SetID(generateOID())
|
||||
obj.SetOwnerID(ownertest.GenerateID())
|
||||
obj.SetOwnerID(ownertest.ID())
|
||||
obj.SetContainerID(cid)
|
||||
obj.SetVersion(version)
|
||||
obj.SetPayloadChecksum(csum)
|
||||
|
|
|
@ -33,7 +33,7 @@ func TestAuditResults(t *testing.T) {
|
|||
auditClientWrapper, err := auditWrapper.NewFromMorph(morphClient, auditHash, 0)
|
||||
require.NoError(t, err)
|
||||
|
||||
id := cidtest.GenerateID()
|
||||
id := cidtest.ID()
|
||||
|
||||
auditRes := auditAPI.NewResult()
|
||||
auditRes.SetAuditEpoch(epoch)
|
||||
|
|
|
@ -75,7 +75,7 @@ func (s *testAnnouncementStorage) Close() error {
|
|||
|
||||
func randAnnouncement() container.UsedSpaceAnnouncement {
|
||||
a := container.NewAnnouncement()
|
||||
a.SetContainerID(cidtest.GenerateID())
|
||||
a.SetContainerID(cidtest.ID())
|
||||
a.SetUsedSpace(rand.Uint64())
|
||||
|
||||
return *a
|
||||
|
|
|
@ -13,7 +13,7 @@ func TestStorage(t *testing.T) {
|
|||
const epoch uint64 = 13
|
||||
|
||||
a := container.NewAnnouncement()
|
||||
a.SetContainerID(cidtest.GenerateID())
|
||||
a.SetContainerID(cidtest.ID())
|
||||
a.SetEpoch(epoch)
|
||||
|
||||
const opinionsNum = 100
|
||||
|
|
|
@ -46,10 +46,10 @@ func TestStickyCheck(t *testing.T) {
|
|||
info.requestRole = eacl.RoleSystem
|
||||
|
||||
info.basicACL.SetSticky()
|
||||
require.True(t, stickyBitCheck(info, ownertest.GenerateID()))
|
||||
require.True(t, stickyBitCheck(info, ownertest.ID()))
|
||||
|
||||
info.basicACL.ResetSticky()
|
||||
require.True(t, stickyBitCheck(info, ownertest.GenerateID()))
|
||||
require.True(t, stickyBitCheck(info, ownertest.ID()))
|
||||
})
|
||||
|
||||
t.Run("owner ID and/or public key emptiness", func(t *testing.T) {
|
||||
|
@ -73,7 +73,7 @@ func TestStickyCheck(t *testing.T) {
|
|||
var ownerID *owner.ID
|
||||
|
||||
if withOwner {
|
||||
ownerID = ownertest.GenerateID()
|
||||
ownerID = ownertest.ID()
|
||||
}
|
||||
|
||||
require.Equal(t, expected, stickyBitCheck(info, ownerID))
|
||||
|
|
|
@ -61,7 +61,7 @@ func testID(t *testing.T) *objectSDK.ID {
|
|||
func testAddress(t *testing.T) *objectSDK.Address {
|
||||
addr := objectSDK.NewAddress()
|
||||
addr.SetObjectID(testID(t))
|
||||
addr.SetContainerID(cidtest.GenerateID())
|
||||
addr.SetContainerID(cidtest.ID())
|
||||
|
||||
return addr
|
||||
}
|
||||
|
|
|
@ -189,7 +189,7 @@ func generateAddress() *objectSDK.Address {
|
|||
addr := objectSDK.NewAddress()
|
||||
addr.SetObjectID(generateID())
|
||||
|
||||
addr.SetContainerID(cidtest.GenerateID())
|
||||
addr.SetContainerID(cidtest.ID())
|
||||
|
||||
return addr
|
||||
}
|
||||
|
|
|
@ -159,7 +159,7 @@ func TestGetLocalOnly(t *testing.T) {
|
|||
storage := newTestStorage()
|
||||
svc := newSvc(storage)
|
||||
|
||||
cid := cidtest.GenerateID()
|
||||
cid := cidtest.ID()
|
||||
ids := generateIDs(10)
|
||||
storage.addResult(cid, ids, nil)
|
||||
|
||||
|
@ -175,7 +175,7 @@ func TestGetLocalOnly(t *testing.T) {
|
|||
storage := newTestStorage()
|
||||
svc := newSvc(storage)
|
||||
|
||||
cid := cidtest.GenerateID()
|
||||
cid := cidtest.ID()
|
||||
testErr := errors.New("any error")
|
||||
storage.addResult(cid, nil, testErr)
|
||||
|
||||
|
|
Loading…
Reference in a new issue