From 3634ca50caeadd23e28bfa57daf73ecf8cabca6e Mon Sep 17 00:00:00 2001 From: Dirk McCormick Date: Mon, 23 Nov 2020 16:09:09 +0100 Subject: [PATCH] fix: sector-storage tests --- extern/sector-storage/ffiwrapper/sealer_cgo.go | 4 ++-- extern/sector-storage/fr32/fr32_ffi_cmp_test.go | 5 +++-- extern/sector-storage/fr32/fr32_test.go | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/extern/sector-storage/ffiwrapper/sealer_cgo.go b/extern/sector-storage/ffiwrapper/sealer_cgo.go index eb7fd6db9..1c8c7ee84 100644 --- a/extern/sector-storage/ffiwrapper/sealer_cgo.go +++ b/extern/sector-storage/ffiwrapper/sealer_cgo.go @@ -20,7 +20,7 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/specs-storage/storage" - "github.com/filecoin-project/go-commp-utils/ffiwrapper" + commpffi "github.com/filecoin-project/go-commp-utils/ffiwrapper" "github.com/filecoin-project/go-commp-utils/zerocomm" "github.com/filecoin-project/lotus/extern/sector-storage/fr32" "github.com/filecoin-project/lotus/extern/sector-storage/storiface" @@ -176,7 +176,7 @@ func (sb *Sealer) AddPiece(ctx context.Context, sector storage.SectorRef, existi } func (sb *Sealer) pieceCid(spt abi.RegisteredSealProof, in []byte) (cid.Cid, error) { - prf, werr, err := ffiwrapper.ToReadableFile(bytes.NewReader(in), int64(len(in))) + prf, werr, err := commpffi.ToReadableFile(bytes.NewReader(in), int64(len(in))) if err != nil { return cid.Undef, xerrors.Errorf("getting tee reader pipe: %w", err) } diff --git a/extern/sector-storage/fr32/fr32_ffi_cmp_test.go b/extern/sector-storage/fr32/fr32_ffi_cmp_test.go index 3d5679095..49eb11548 100644 --- a/extern/sector-storage/fr32/fr32_ffi_cmp_test.go +++ b/extern/sector-storage/fr32/fr32_ffi_cmp_test.go @@ -7,11 +7,12 @@ import ( "os" "testing" - "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" "github.com/filecoin-project/lotus/extern/sector-storage/fr32" ffi "github.com/filecoin-project/filecoin-ffi" + commpffi "github.com/filecoin-project/go-commp-utils/ffiwrapper" + "github.com/filecoin-project/go-state-types/abi" "github.com/stretchr/testify/require" @@ -29,7 +30,7 @@ func TestWriteTwoPcs(t *testing.T) { buf := bytes.Repeat([]byte{0xab * byte(i)}, int(paddedSize.Unpadded())) rawBytes = append(rawBytes, buf...) - rf, w, _ := ffiwrapper.ToReadableFile(bytes.NewReader(buf), int64(len(buf))) + rf, w, _ := commpffi.ToReadableFile(bytes.NewReader(buf), int64(len(buf))) _, _, _, err := ffi.WriteWithAlignment(abi.RegisteredSealProof_StackedDrg32GiBV1, rf, abi.UnpaddedPieceSize(len(buf)), tf, nil) if err != nil { diff --git a/extern/sector-storage/fr32/fr32_test.go b/extern/sector-storage/fr32/fr32_test.go index 415134272..0626f72a9 100644 --- a/extern/sector-storage/fr32/fr32_test.go +++ b/extern/sector-storage/fr32/fr32_test.go @@ -9,15 +9,15 @@ import ( "testing" ffi "github.com/filecoin-project/filecoin-ffi" + commpffi "github.com/filecoin-project/go-commp-utils/ffiwrapper" "github.com/filecoin-project/go-state-types/abi" "github.com/stretchr/testify/require" - "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" "github.com/filecoin-project/lotus/extern/sector-storage/fr32" ) func padFFI(buf []byte) []byte { - rf, w, _ := ffiwrapper.ToReadableFile(bytes.NewReader(buf), int64(len(buf))) + rf, w, _ := commpffi.ToReadableFile(bytes.NewReader(buf), int64(len(buf))) tf, _ := ioutil.TempFile("/tmp/", "scrb-") _, _, _, err := ffi.WriteWithAlignment(abi.RegisteredSealProof_StackedDrg32GiBV1, rf, abi.UnpaddedPieceSize(len(buf)), tf, nil)