[#979] Upgrade SDK NeoFS Go dependency

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-12-01 16:56:48 +03:00 committed by LeL
parent 3fcd7bc948
commit 6f41cd86ed
33 changed files with 53 additions and 53 deletions

4
go.mod
View file

@ -12,8 +12,8 @@ require (
github.com/multiformats/go-multiaddr v0.4.0 github.com/multiformats/go-multiaddr v0.4.0
github.com/nspcc-dev/hrw v1.0.9 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/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-api-go/v2 v2.11.0-pre.0.20211201134523-3604d96f3fe1
github.com/nspcc-dev/neofs-sdk-go v0.0.0-20211126125208-279a5a1e0bfe github.com/nspcc-dev/neofs-sdk-go v0.0.0-20211201135501-471ed5a3ec0b
github.com/nspcc-dev/tzhash v1.4.0 github.com/nspcc-dev/tzhash v1.4.0
github.com/panjf2000/ants/v2 v2.4.0 github.com/panjf2000/ants/v2 v2.4.0
github.com/paulmach/orb v0.2.2 github.com/paulmach/orb v0.2.2

BIN
go.sum

Binary file not shown.

View file

@ -42,7 +42,7 @@ func blankValidObject(t *testing.T, key *ecdsa.PrivateKey) *RawObject {
ownerID.SetNeo3Wallet(wallet) ownerID.SetNeo3Wallet(wallet)
obj := NewRaw() obj := NewRaw()
obj.SetContainerID(cidtest.GenerateID()) obj.SetContainerID(cidtest.ID())
obj.SetOwnerID(ownerID) obj.SetOwnerID(ownerID)
return obj return obj
@ -87,7 +87,7 @@ func TestFormatValidator_Validate(t *testing.T) {
t.Run("unsigned object", func(t *testing.T) { t.Run("unsigned object", func(t *testing.T) {
obj := NewRaw() obj := NewRaw()
obj.SetContainerID(cidtest.GenerateID()) obj.SetContainerID(cidtest.ID())
obj.SetID(testObjectID(t)) obj.SetID(testObjectID(t))
require.Error(t, v.Validate(obj.Object())) 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())) w, err := owner.NEO3WalletFromPublicKey((*ecdsa.PublicKey)(ownerKey.PublicKey()))
require.NoError(t, err) require.NoError(t, err)
tok := sessiontest.Generate() tok := sessiontest.Token()
tok.SetOwnerID(owner.NewIDFromNeo3Wallet(w)) tok.SetOwnerID(owner.NewIDFromNeo3Wallet(w))
obj := NewRaw() obj := NewRaw()
obj.SetContainerID(cidtest.GenerateID()) obj.SetContainerID(cidtest.ID())
obj.SetSessionToken(sessiontest.Generate()) obj.SetSessionToken(sessiontest.Token())
obj.SetOwnerID(tok.OwnerID()) obj.SetOwnerID(tok.OwnerID())
require.NoError(t, object.SetIDWithSignature(&ownerKey.PrivateKey, obj.SDK())) require.NoError(t, object.SetIDWithSignature(&ownerKey.PrivateKey, obj.SDK()))

View file

@ -79,7 +79,7 @@ func generateContainers(n int) []*cid.ID {
result := make([]*cid.ID, 0, n) result := make([]*cid.ID, 0, n)
for i := 0; i < n; i++ { for i := 0; i < n; i++ {
result = append(result, cidtest.GenerateID()) result = append(result, cidtest.ID())
} }
return result return result

View file

@ -101,7 +101,7 @@ func TestPutValidator_Assert(t *testing.T) {
// diff explicit creator and the one in info // diff explicit creator and the one in info
var creator2 owner.ID var creator2 owner.ID
creator2 = *ownertest.GenerateID() creator2 = *ownertest.ID()
e.info.SetOwner(creator2) e.info.SetOwner(creator2)

View file

@ -28,7 +28,7 @@ func testAddress() *objectSDK.Address {
addr := objectSDK.NewAddress() addr := objectSDK.NewAddress()
addr.SetObjectID(oid) addr.SetObjectID(oid)
addr.SetContainerID(cidtest.GenerateID()) addr.SetContainerID(cidtest.ID())
return addr return addr
} }

View file

@ -26,7 +26,7 @@ func testAddress() *objectSDK.Address {
addr := objectSDK.NewAddress() addr := objectSDK.NewAddress()
addr.SetObjectID(oid) addr.SetObjectID(oid)
addr.SetContainerID(cidtest.GenerateID()) addr.SetContainerID(cidtest.ID())
return addr return addr
} }

View file

@ -26,7 +26,7 @@ func testOID() *objectSDK.ID {
func testAddress() *objectSDK.Address { func testAddress() *objectSDK.Address {
a := objectSDK.NewAddress() a := objectSDK.NewAddress()
a.SetObjectID(testOID()) a.SetObjectID(testOID())
a.SetContainerID(cidtest.GenerateID()) a.SetContainerID(cidtest.ID())
return a return a
} }

View file

@ -17,7 +17,7 @@ func TestExecBlocks(t *testing.T) {
}) })
// put some object // put some object
obj := generateRawObjectWithCID(t, cidtest.GenerateID()).Object() obj := generateRawObjectWithCID(t, cidtest.ID()).Object()
addr := obj.Address() addr := obj.Address()

View file

@ -99,7 +99,7 @@ func generateRawObjectWithCID(t *testing.T, cid *cid.ID) *object.RawObject {
obj := object.NewRaw() obj := object.NewRaw()
obj.SetID(testOID()) obj.SetID(testOID())
obj.SetOwnerID(ownertest.GenerateID()) obj.SetOwnerID(ownertest.ID())
obj.SetContainerID(cid) obj.SetContainerID(cid)
obj.SetVersion(version) obj.SetVersion(version)
obj.SetPayloadChecksum(csum) obj.SetPayloadChecksum(csum)

View file

@ -13,7 +13,7 @@ import (
func TestHeadRaw(t *testing.T) { func TestHeadRaw(t *testing.T) {
defer os.RemoveAll(t.Name()) defer os.RemoveAll(t.Name())
cid := cidtest.GenerateID() cid := cidtest.ID()
splitID := objectSDK.NewSplitID() splitID := objectSDK.NewSplitID()
parent := generateRawObjectWithCID(t, cid) parent := generateRawObjectWithCID(t, cid)

View file

@ -13,7 +13,7 @@ import (
func TestStorageEngine_Inhume(t *testing.T) { func TestStorageEngine_Inhume(t *testing.T) {
defer os.RemoveAll(t.Name()) defer os.RemoveAll(t.Name())
cid := cidtest.GenerateID() cid := cidtest.ID()
splitID := objectSDK.NewSplitID() splitID := objectSDK.NewSplitID()
fs := objectSDK.SearchFilters{} fs := objectSDK.SearchFilters{}

View file

@ -27,7 +27,7 @@ func TestListWithCursor(t *testing.T) {
got := make([]*object.Address, 0, total) got := make([]*object.Address, 0, total)
for i := 0; i < total; i++ { for i := 0; i < total; i++ {
containerID := cidtest.GenerateID() containerID := cidtest.ID()
obj := generateRawObjectWithCID(t, containerID) obj := generateRawObjectWithCID(t, containerID)
prm := new(PutPrm).WithObject(obj.Object()) prm := new(PutPrm).WithObject(obj.Object())
_, err := e.Put(prm) _, err := e.Put(prm)

View file

@ -127,7 +127,7 @@ func TestDB_ContainerSize(t *testing.T) {
objs := make(map[*cid.ID][]*object.RawObject, C*N) objs := make(map[*cid.ID][]*object.RawObject, C*N)
for i := 0; i < C; i++ { for i := 0; i < C; i++ {
cid := cidtest.GenerateID() cid := cidtest.ID()
cids[cid] = 0 cids[cid] = 0
for j := 0; j < N; j++ { for j := 0; j < N; j++ {

View file

@ -61,7 +61,7 @@ func newDB(t testing.TB) *meta.DB {
} }
func generateRawObject(t *testing.T) *object.RawObject { 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 { 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 := object.NewRaw()
obj.SetID(testOID()) obj.SetID(testOID())
obj.SetOwnerID(ownertest.GenerateID()) obj.SetOwnerID(ownertest.ID())
obj.SetContainerID(cid) obj.SetContainerID(cid)
obj.SetVersion(version) obj.SetVersion(version)
obj.SetPayloadChecksum(csum) obj.SetPayloadChecksum(csum)
@ -92,7 +92,7 @@ func generateRawObjectWithCID(t *testing.T, cid *cid.ID) *object.RawObject {
func generateAddress() *objectSDK.Address { func generateAddress() *objectSDK.Address {
addr := objectSDK.NewAddress() addr := objectSDK.NewAddress()
addr.SetContainerID(cidtest.GenerateID()) addr.SetContainerID(cidtest.ID())
addr.SetObjectID(testOID()) addr.SetObjectID(testOID())
return addr return addr

View file

@ -13,7 +13,7 @@ import (
func TestDB_Delete(t *testing.T) { func TestDB_Delete(t *testing.T) {
db := newDB(t) db := newDB(t)
cid := cidtest.GenerateID() cid := cidtest.ID()
parent := generateRawObjectWithCID(t, cid) parent := generateRawObjectWithCID(t, cid)
addAttribute(parent, "foo", "bar") addAttribute(parent, "foo", "bar")
@ -69,7 +69,7 @@ func TestDB_Delete(t *testing.T) {
func TestDeleteAllChildren(t *testing.T) { func TestDeleteAllChildren(t *testing.T) {
db := newDB(t) db := newDB(t)
cid := cidtest.GenerateID() cid := cidtest.ID()
// generate parent object // generate parent object
parent := generateRawObjectWithCID(t, cid) parent := generateRawObjectWithCID(t, cid)

View file

@ -55,7 +55,7 @@ func TestDB_Exists(t *testing.T) {
}) })
t.Run("virtual object", func(t *testing.T) { t.Run("virtual object", func(t *testing.T) {
cid := cidtest.GenerateID() cid := cidtest.ID()
parent := generateRawObjectWithCID(t, cid) parent := generateRawObjectWithCID(t, cid)
child := 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) { t.Run("merge split info", func(t *testing.T) {
cid := cidtest.GenerateID() cid := cidtest.ID()
splitID := objectSDK.NewSplitID() splitID := objectSDK.NewSplitID()
parent := generateRawObjectWithCID(t, cid) parent := generateRawObjectWithCID(t, cid)

View file

@ -59,7 +59,7 @@ func TestDB_Get(t *testing.T) {
}) })
t.Run("put virtual object", func(t *testing.T) { t.Run("put virtual object", func(t *testing.T) {
cid := cidtest.GenerateID() cid := cidtest.ID()
splitID := objectSDK.NewSplitID() splitID := objectSDK.NewSplitID()
parent := generateRawObjectWithCID(t, cid) parent := generateRawObjectWithCID(t, cid)

View file

@ -23,7 +23,7 @@ func TestLisObjectsWithCursor(t *testing.T) {
// fill metabase with objects // fill metabase with objects
for i := 0; i < containers; i++ { for i := 0; i < containers; i++ {
containerID := cidtest.GenerateID() containerID := cidtest.ID()
// add one regular object // add one regular object
obj := generateRawObjectWithCID(t, containerID) obj := generateRawObjectWithCID(t, containerID)

View file

@ -15,7 +15,7 @@ import (
func TestDB_SelectUserAttributes(t *testing.T) { func TestDB_SelectUserAttributes(t *testing.T) {
db := newDB(t) db := newDB(t)
cid := cidtest.GenerateID() cid := cidtest.ID()
raw1 := generateRawObjectWithCID(t, cid) raw1 := generateRawObjectWithCID(t, cid)
addAttribute(raw1, "foo", "bar") addAttribute(raw1, "foo", "bar")
@ -137,7 +137,7 @@ func TestDB_SelectUserAttributes(t *testing.T) {
func TestDB_SelectRootPhyParent(t *testing.T) { func TestDB_SelectRootPhyParent(t *testing.T) {
db := newDB(t) db := newDB(t)
cid := cidtest.GenerateID() cid := cidtest.ID()
// prepare // prepare
@ -304,7 +304,7 @@ func TestDB_SelectRootPhyParent(t *testing.T) {
func TestDB_SelectInhume(t *testing.T) { func TestDB_SelectInhume(t *testing.T) {
db := newDB(t) db := newDB(t)
cid := cidtest.GenerateID() cid := cidtest.ID()
raw1 := generateRawObjectWithCID(t, cid) raw1 := generateRawObjectWithCID(t, cid)
err := putBig(db, raw1.Object()) err := putBig(db, raw1.Object())
@ -336,7 +336,7 @@ func TestDB_SelectInhume(t *testing.T) {
func TestDB_SelectPayloadHash(t *testing.T) { func TestDB_SelectPayloadHash(t *testing.T) {
db := newDB(t) db := newDB(t)
cid := cidtest.GenerateID() cid := cidtest.ID()
raw1 := generateRawObjectWithCID(t, cid) raw1 := generateRawObjectWithCID(t, cid)
err := putBig(db, raw1.Object()) err := putBig(db, raw1.Object())
@ -371,7 +371,7 @@ func TestDB_SelectPayloadHash(t *testing.T) {
func TestDB_SelectWithSlowFilters(t *testing.T) { func TestDB_SelectWithSlowFilters(t *testing.T) {
db := newDB(t) db := newDB(t)
cid := cidtest.GenerateID() cid := cidtest.ID()
v20 := new(version.Version) v20 := new(version.Version)
v20.SetMajor(2) v20.SetMajor(2)
@ -469,7 +469,7 @@ func TestDB_SelectWithSlowFilters(t *testing.T) {
func TestDB_SelectObjectID(t *testing.T) { func TestDB_SelectObjectID(t *testing.T) {
db := newDB(t) db := newDB(t)
cid := cidtest.GenerateID() cid := cidtest.ID()
// prepare // prepare
@ -577,7 +577,7 @@ func TestDB_SelectObjectID(t *testing.T) {
func TestDB_SelectSplitID(t *testing.T) { func TestDB_SelectSplitID(t *testing.T) {
db := newDB(t) db := newDB(t)
cid := cidtest.GenerateID() cid := cidtest.ID()
child1 := generateRawObjectWithCID(t, cid) child1 := generateRawObjectWithCID(t, cid)
child2 := generateRawObjectWithCID(t, cid) child2 := generateRawObjectWithCID(t, cid)
@ -631,7 +631,7 @@ func TestDB_SelectSplitID(t *testing.T) {
func TestDB_SelectContainerID(t *testing.T) { func TestDB_SelectContainerID(t *testing.T) {
db := newDB(t) db := newDB(t)
cid := cidtest.GenerateID() cid := cidtest.ID()
obj1 := generateRawObjectWithCID(t, cid) obj1 := generateRawObjectWithCID(t, cid)
err := putBig(db, obj1.Object()) err := putBig(db, obj1.Object())
@ -665,7 +665,7 @@ func TestDB_SelectContainerID(t *testing.T) {
}) })
t.Run("not same cid", func(t *testing.T) { t.Run("not same cid", func(t *testing.T) {
newCID := cidtest.GenerateID() newCID := cidtest.ID()
fs := objectSDK.SearchFilters{} fs := objectSDK.SearchFilters{}
fs.AddObjectContainerIDFilter(objectSDK.MatchStringEqual, newCID) fs.AddObjectContainerIDFilter(objectSDK.MatchStringEqual, newCID)

View file

@ -23,7 +23,7 @@ func testShardDelete(t *testing.T, hasWriteCache bool) {
sh := newShard(t, hasWriteCache) sh := newShard(t, hasWriteCache)
defer releaseShard(sh, t) defer releaseShard(sh, t)
cid := cidtest.GenerateID() cid := cidtest.ID()
obj := generateRawObjectWithCID(t, cid) obj := generateRawObjectWithCID(t, cid)
addAttribute(obj, "foo", "bar") addAttribute(obj, "foo", "bar")

View file

@ -68,7 +68,7 @@ func testShardGet(t *testing.T, hasWriteCache bool) {
t.Run("parent object", func(t *testing.T) { t.Run("parent object", func(t *testing.T) {
obj := generateRawObject(t) obj := generateRawObject(t)
addAttribute(obj, "foo", "bar") addAttribute(obj, "foo", "bar")
cid := cidtest.GenerateID() cid := cidtest.ID()
splitID := objectSDK.NewSplitID() splitID := objectSDK.NewSplitID()
parent := generateRawObjectWithCID(t, cid) parent := generateRawObjectWithCID(t, cid)

View file

@ -46,7 +46,7 @@ func testShardHead(t *testing.T, hasWriteCache bool) {
}) })
t.Run("virtual object", func(t *testing.T) { t.Run("virtual object", func(t *testing.T) {
cid := cidtest.GenerateID() cid := cidtest.ID()
splitID := objectSDK.NewSplitID() splitID := objectSDK.NewSplitID()
parent := generateRawObjectWithCID(t, cid) parent := generateRawObjectWithCID(t, cid)

View file

@ -23,7 +23,7 @@ func testShardInhume(t *testing.T, hasWriteCache bool) {
sh := newShard(t, hasWriteCache) sh := newShard(t, hasWriteCache)
defer releaseShard(sh, t) defer releaseShard(sh, t)
cid := cidtest.GenerateID() cid := cidtest.ID()
obj := generateRawObjectWithCID(t, cid) obj := generateRawObjectWithCID(t, cid)
addAttribute(obj, "foo", "bar") addAttribute(obj, "foo", "bar")

View file

@ -34,7 +34,7 @@ func testShardList(t *testing.T, sh *shard.Shard) {
putPrm := new(shard.PutPrm) putPrm := new(shard.PutPrm)
for i := 0; i < C; i++ { for i := 0; i < C; i++ {
cid := cidtest.GenerateID() cid := cidtest.ID()
for j := 0; j < N; j++ { for j := 0; j < N; j++ {
obj := generateRawObjectWithCID(t, cid) obj := generateRawObjectWithCID(t, cid)

View file

@ -65,7 +65,7 @@ func releaseShard(s *shard.Shard, t testing.TB) {
} }
func generateRawObject(t *testing.T) *object.RawObject { 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 { 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 := object.NewRaw()
obj.SetID(generateOID()) obj.SetID(generateOID())
obj.SetOwnerID(ownertest.GenerateID()) obj.SetOwnerID(ownertest.ID())
obj.SetContainerID(cid) obj.SetContainerID(cid)
obj.SetVersion(version) obj.SetVersion(version)
obj.SetPayloadChecksum(csum) obj.SetPayloadChecksum(csum)

View file

@ -33,7 +33,7 @@ func TestAuditResults(t *testing.T) {
auditClientWrapper, err := auditWrapper.NewFromMorph(morphClient, auditHash, 0) auditClientWrapper, err := auditWrapper.NewFromMorph(morphClient, auditHash, 0)
require.NoError(t, err) require.NoError(t, err)
id := cidtest.GenerateID() id := cidtest.ID()
auditRes := auditAPI.NewResult() auditRes := auditAPI.NewResult()
auditRes.SetAuditEpoch(epoch) auditRes.SetAuditEpoch(epoch)

View file

@ -75,7 +75,7 @@ func (s *testAnnouncementStorage) Close() error {
func randAnnouncement() container.UsedSpaceAnnouncement { func randAnnouncement() container.UsedSpaceAnnouncement {
a := container.NewAnnouncement() a := container.NewAnnouncement()
a.SetContainerID(cidtest.GenerateID()) a.SetContainerID(cidtest.ID())
a.SetUsedSpace(rand.Uint64()) a.SetUsedSpace(rand.Uint64())
return *a return *a

View file

@ -13,7 +13,7 @@ func TestStorage(t *testing.T) {
const epoch uint64 = 13 const epoch uint64 = 13
a := container.NewAnnouncement() a := container.NewAnnouncement()
a.SetContainerID(cidtest.GenerateID()) a.SetContainerID(cidtest.ID())
a.SetEpoch(epoch) a.SetEpoch(epoch)
const opinionsNum = 100 const opinionsNum = 100

View file

@ -46,10 +46,10 @@ func TestStickyCheck(t *testing.T) {
info.requestRole = eacl.RoleSystem info.requestRole = eacl.RoleSystem
info.basicACL.SetSticky() info.basicACL.SetSticky()
require.True(t, stickyBitCheck(info, ownertest.GenerateID())) require.True(t, stickyBitCheck(info, ownertest.ID()))
info.basicACL.ResetSticky() 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) { 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 var ownerID *owner.ID
if withOwner { if withOwner {
ownerID = ownertest.GenerateID() ownerID = ownertest.ID()
} }
require.Equal(t, expected, stickyBitCheck(info, ownerID)) require.Equal(t, expected, stickyBitCheck(info, ownerID))

View file

@ -61,7 +61,7 @@ func testID(t *testing.T) *objectSDK.ID {
func testAddress(t *testing.T) *objectSDK.Address { func testAddress(t *testing.T) *objectSDK.Address {
addr := objectSDK.NewAddress() addr := objectSDK.NewAddress()
addr.SetObjectID(testID(t)) addr.SetObjectID(testID(t))
addr.SetContainerID(cidtest.GenerateID()) addr.SetContainerID(cidtest.ID())
return addr return addr
} }

View file

@ -189,7 +189,7 @@ func generateAddress() *objectSDK.Address {
addr := objectSDK.NewAddress() addr := objectSDK.NewAddress()
addr.SetObjectID(generateID()) addr.SetObjectID(generateID())
addr.SetContainerID(cidtest.GenerateID()) addr.SetContainerID(cidtest.ID())
return addr return addr
} }

View file

@ -159,7 +159,7 @@ func TestGetLocalOnly(t *testing.T) {
storage := newTestStorage() storage := newTestStorage()
svc := newSvc(storage) svc := newSvc(storage)
cid := cidtest.GenerateID() cid := cidtest.ID()
ids := generateIDs(10) ids := generateIDs(10)
storage.addResult(cid, ids, nil) storage.addResult(cid, ids, nil)
@ -175,7 +175,7 @@ func TestGetLocalOnly(t *testing.T) {
storage := newTestStorage() storage := newTestStorage()
svc := newSvc(storage) svc := newSvc(storage)
cid := cidtest.GenerateID() cid := cidtest.ID()
testErr := errors.New("any error") testErr := errors.New("any error")
storage.addResult(cid, nil, testErr) storage.addResult(cid, nil, testErr)