Fix sector-storage tests

This commit is contained in:
Łukasz Magiera 2021-11-26 18:16:53 +01:00
parent a9ee263682
commit f6de16e95a
2 changed files with 1 additions and 3 deletions

View File

@ -5,7 +5,6 @@ import (
"context" "context"
"crypto/sha256" "crypto/sha256"
"fmt" "fmt"
sectorstorage "github.com/filecoin-project/lotus/extern/sector-storage"
"io" "io"
"io/ioutil" "io/ioutil"
"math/rand" "math/rand"
@ -626,4 +625,3 @@ var MockProver = MockVerifier
var _ storage.Sealer = &SectorMgr{} var _ storage.Sealer = &SectorMgr{}
var _ ffiwrapper.Verifier = MockVerifier var _ ffiwrapper.Verifier = MockVerifier
var _ ffiwrapper.Prover = MockProver var _ ffiwrapper.Prover = MockProver
var _ sectorstorage.PieceProvider = &SectorMgr{}

View File

@ -337,7 +337,7 @@ func (p *pieceProviderTestHarness) isUnsealed(t *testing.T, offset storiface.Unp
func (p *pieceProviderTestHarness) readPiece(t *testing.T, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, func (p *pieceProviderTestHarness) readPiece(t *testing.T, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize,
expectedHadToUnseal bool, expectedBytes []byte) { expectedHadToUnseal bool, expectedBytes []byte) {
rd, isUnsealed, err := p.pp.ReadPiece(p.ctx, p.sector, offset, size, p.ticket, p.commD) rd, isUnsealed, err := p.pp.ReadPiece(p.ctx, p.sector, offset, 0, size, p.ticket, p.commD)
require.NoError(t, err) require.NoError(t, err)
require.NotNil(t, rd) require.NotNil(t, rd)
require.Equal(t, expectedHadToUnseal, isUnsealed) require.Equal(t, expectedHadToUnseal, isUnsealed)