private/testuplink: delete delete
ecclient.Delete is a deprecated func that shouldn't be used anymore. Change-Id: Ica4d17e334220311c99cea28f1d0e2d854d72896
This commit is contained in:
parent
0300076684
commit
e655e160dc
@ -56,9 +56,6 @@ func TestECClient(t *testing.T) {
|
||||
|
||||
// Download the pieces and erasure decode the data
|
||||
testGet(ctx, t, planet, ec, es, data, successfulNodes, successfulHashes)
|
||||
|
||||
// Delete the pieces
|
||||
testDelete(ctx, t, planet, ec, successfulNodes, successfulHashes)
|
||||
})
|
||||
}
|
||||
|
||||
@ -127,23 +124,6 @@ func testGet(ctx context.Context, t *testing.T, planet *testplanet.Planet, ec ec
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
func testDelete(ctx context.Context, t *testing.T, planet *testplanet.Planet, ec ecclient.Client, successfulNodes []*pb.Node, successfulHashes []*pb.PieceHash) {
|
||||
piecePublicKey, piecePrivateKey, err := storj.NewPieceKey()
|
||||
require.NoError(t, err)
|
||||
|
||||
limits := make([]*pb.AddressedOrderLimit, len(successfulNodes))
|
||||
for i := 0; i < len(limits); i++ {
|
||||
if successfulNodes[i] != nil {
|
||||
limits[i], err = newAddressedOrderLimit(ctx, pb.PieceAction_DELETE, planet.Satellites[0], piecePublicKey, planet.StorageNodes[i], successfulHashes[i].PieceId)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
}
|
||||
|
||||
err = ec.Delete(ctx, limits, piecePrivateKey)
|
||||
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
func newAddressedOrderLimit(ctx context.Context, action pb.PieceAction, satellite *testplanet.Satellite, piecePublicKey storj.PiecePublicKey, storageNode *testplanet.StorageNode, pieceID storj.PieceID) (*pb.AddressedOrderLimit, error) {
|
||||
// TODO refactor to avoid OrderLimit duplication
|
||||
serialNumber := testrand.SerialNumber()
|
||||
|
Loading…
Reference in New Issue
Block a user