Skip to content

Commit

Permalink
fix compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
willscott committed Sep 11, 2023
1 parent 17ac359 commit 41ee07f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions itests/data_segment_index_retrieval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ func TestDataSegmentIndexRetrieval(t *testing.T) {
r2, err := cid.Parse("bafybeid26fjobqnhvdfv37x3diuvzkbnby3unm3m7fka4trgqwxlauk6by")
require.NoError(t, err)

outF1 := f.RetrieveDirect(ctx, t, r1, &pieceCid, true)
outF1 := f.RetrieveDirect(ctx, t, r1, &pieceCid, true, nil)
r, err := carv2.OpenReader(outF1)
require.NoError(t, err)
rs, err := r.Roots()
require.NoError(t, err)
require.Equal(t, r1, rs[0])
r.Close()
outf2 := f.RetrieveDirect(ctx, t, r2, &pieceCid, true)
outf2 := f.RetrieveDirect(ctx, t, r2, &pieceCid, true, nil)
r, err = carv2.OpenReader(outf2)
require.NoError(t, err)
rs, err = r.Roots()
Expand Down
3 changes: 2 additions & 1 deletion piecedirectory/piecedirectory_test_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@ func testDataSegmentIndex(ctx context.Context, t *testing.T, cl *client.Store) {
require.NoError(t, err)

paddedPieceSize := abi.PaddedPieceSize(fstat.Size())
rdr, err := pr.GetReader(ctx, 0, 0, paddedPieceSize)
maddr := address.TestAddress
rdr, err := pr.GetReader(ctx, maddr, 0, 0, paddedPieceSize)
require.NoError(t, err)
pieceCid := CalculateCommp(t, rdr).PieceCID

Expand Down
4 changes: 2 additions & 2 deletions piecedirectory/test_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ func (MockSectionReader) Close() error { return nil }
func CreateMockPieceReaderFromPath(t *testing.T, path string) *mock_piecedirectory.MockPieceReader {
ctrl := gomock.NewController(t)
pr := mock_piecedirectory.NewMockPieceReader(ctrl)
pr.EXPECT().GetReader(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes().DoAndReturn(
func(_ context.Context, _ abi.SectorNumber, _ abi.PaddedPieceSize, _ abi.PaddedPieceSize) (types.SectionReader, error) {
pr.EXPECT().GetReader(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes().DoAndReturn(
func(_ context.Context, _ address.Address, _ abi.SectorNumber, _ abi.PaddedPieceSize, _ abi.PaddedPieceSize) (types.SectionReader, error) {
f, err := os.Open(path)
return f, err
})
Expand Down

0 comments on commit 41ee07f

Please sign in to comment.