private/testuplink: delete delete

ecclient.Delete is a deprecated func that shouldn't be used anymore.

Change-Id: Ica4d17e334220311c99cea28f1d0e2d854d72896
This commit is contained in:
Egon Elbre 2020-04-21 15:29:51 +03:00 committed by Stefan Benten
parent 0300076684
commit e655e160dc

View File

@ -56,9 +56,6 @@ func TestECClient(t *testing.T) {
// Download the pieces and erasure decode the data // Download the pieces and erasure decode the data
testGet(ctx, t, planet, ec, es, data, successfulNodes, successfulHashes) 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) 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) { 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 // TODO refactor to avoid OrderLimit duplication
serialNumber := testrand.SerialNumber() serialNumber := testrand.SerialNumber()