From e4fab975ad9c89d58daad0964141d3e6a1b3531b Mon Sep 17 00:00:00 2001 From: Michal Niewrzal Date: Mon, 7 Nov 2022 14:48:31 +0100 Subject: [PATCH] satellite/metainfo: fix types used in tests Libuplink is using some aliases to storj package which we will move directly to libuplink and remove from common/storj. To make code compilable we need to fix places where we are using aliased types directly to be able to update libuplink. Change-Id: I7222a927af3b41e214d1c9204917f3ebce4727ce --- satellite/metainfo/endpoint_object_test.go | 10 +++++----- satellite/metainfo/endpoint_segment_test.go | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/satellite/metainfo/endpoint_object_test.go b/satellite/metainfo/endpoint_object_test.go index cc585a99f..efd7402b1 100644 --- a/satellite/metainfo/endpoint_object_test.go +++ b/satellite/metainfo/endpoint_object_test.go @@ -781,7 +781,7 @@ func TestEndpoint_Object_With_StorageNodes(t *testing.T) { response, err := metainfoClient.BeginSegment(ctx, metaclient.BeginSegmentParams{ StreamID: beginObjectResponse.StreamID, - Position: storj.SegmentPosition{ + Position: metaclient.SegmentPosition{ Index: 0, }, MaxOrderLimit: memory.MiB.Int64(), @@ -815,7 +815,7 @@ func TestEndpoint_Object_With_StorageNodes(t *testing.T) { } err = metainfoClient.CommitSegment(ctx, metaclient.CommitSegmentParams{ SegmentID: response.SegmentID, - Encryption: storj.SegmentEncryption{ + Encryption: metaclient.SegmentEncryption{ EncryptedKey: testrand.Bytes(256), }, PlainSize: 5000, @@ -1031,7 +1031,7 @@ func TestEndpoint_Object_With_StorageNodes(t *testing.T) { require.NoError(t, err) _, err = metainfoClient.DownloadSegmentWithRS(ctx, metaclient.DownloadSegmentParams{ StreamID: object.StreamID, - Position: storj.SegmentPosition{ + Position: metaclient.SegmentPosition{ Index: -1, }, }) @@ -1049,7 +1049,7 @@ func TestEndpoint_Object_With_StorageNodes(t *testing.T) { require.NoError(t, err) _, err = metainfoClient.DownloadSegmentWithRS(ctx, metaclient.DownloadSegmentParams{ StreamID: object.StreamID, - Position: storj.SegmentPosition{ + Position: metaclient.SegmentPosition{ Index: -1, }, }) @@ -1068,7 +1068,7 @@ func TestEndpoint_Object_With_StorageNodes(t *testing.T) { require.NoError(t, err) _, err = metainfoClient.DownloadSegmentWithRS(ctx, metaclient.DownloadSegmentParams{ StreamID: object.StreamID, - Position: storj.SegmentPosition{ + Position: metaclient.SegmentPosition{ Index: -1, }, }) diff --git a/satellite/metainfo/endpoint_segment_test.go b/satellite/metainfo/endpoint_segment_test.go index 380adf5cc..6c677cdaa 100644 --- a/satellite/metainfo/endpoint_segment_test.go +++ b/satellite/metainfo/endpoint_segment_test.go @@ -133,12 +133,12 @@ func TestInlineSegment(t *testing.T) { segmentsData[i] = testrand.Bytes(memory.KiB) err = metainfoClient.MakeInlineSegment(ctx, metaclient.MakeInlineSegmentParams{ StreamID: beginObjectResp.StreamID, - Position: storj.SegmentPosition{ + Position: metaclient.SegmentPosition{ Index: segment, }, PlainSize: 1024, EncryptedInlineData: segmentsData[i], - Encryption: storj.SegmentEncryption{ + Encryption: metaclient.SegmentEncryption{ EncryptedKey: testrand.Bytes(256), }, }) @@ -188,11 +188,11 @@ func TestInlineSegment(t *testing.T) { data := testrand.Bytes(10 * memory.KiB) err = metainfoClient.MakeInlineSegment(ctx, metaclient.MakeInlineSegmentParams{ StreamID: beginObjectResp.StreamID, - Position: storj.SegmentPosition{ + Position: metaclient.SegmentPosition{ Index: 0, }, EncryptedInlineData: data, - Encryption: storj.SegmentEncryption{ + Encryption: metaclient.SegmentEncryption{ EncryptedKey: testrand.Bytes(256), }, }) @@ -205,7 +205,7 @@ func TestInlineSegment(t *testing.T) { for i, index := range existingSegments { response, err := metainfoClient.DownloadSegmentWithRS(ctx, metaclient.DownloadSegmentParams{ StreamID: object.StreamID, - Position: storj.SegmentPosition{ + Position: metaclient.SegmentPosition{ Index: index, }, }) @@ -264,7 +264,7 @@ func TestRemoteSegment(t *testing.T) { response, err := metainfoClient.DownloadSegmentWithRS(ctx, metaclient.DownloadSegmentParams{ StreamID: object.StreamID, - Position: storj.SegmentPosition{ + Position: metaclient.SegmentPosition{ Index: -1, }, }) @@ -430,7 +430,7 @@ func TestCommitSegment_Validation(t *testing.T) { response, err := client.BeginSegment(ctx, metaclient.BeginSegmentParams{ StreamID: beginObjectResponse.StreamID, - Position: storj.SegmentPosition{ + Position: metaclient.SegmentPosition{ Index: 0, }, MaxOrderLimit: memory.MiB.Int64(),