fix lint errors.

This commit is contained in:
Raúl Kripalani 2021-07-30 15:25:18 +01:00
parent 2e30891005
commit 932767d014
4 changed files with 8 additions and 8 deletions

View File

@ -65,7 +65,6 @@ func (m *lotusAccessor) IsUnsealed(ctx context.Context, pieceCid cid.Cid) (bool,
return false, xerrors.Errorf("failed while waiting for accessor to start: %w", err)
}
var pieceInfo piecestore.PieceInfo
err = m.throttle.Do(ctx, func(ctx context.Context) (err error) {
pieceInfo, err = m.pieceStore.GetPieceInfo(pieceCid)

View File

@ -45,9 +45,9 @@ func TestLotusAccessorFetchUnsealedPiece(t *testing.T) {
name string
deals []abi.SectorNumber
fetchedData string
isUnsealed bool
isUnsealed bool
expectErr bool
expectErr bool
}{{
// Expect error if there is no deal info for piece CID
name: "no deals",
@ -58,13 +58,13 @@ func TestLotusAccessorFetchUnsealedPiece(t *testing.T) {
name: "prefer unsealed deal",
deals: []abi.SectorNumber{unsealedSectorID, sealedSectorID},
fetchedData: unsealedSectorData,
isUnsealed: true,
isUnsealed: true,
}, {
// Expect the API to unseal the data if there are no unsealed deals
name: "unseal if necessary",
deals: []abi.SectorNumber{sealedSectorID},
fetchedData: sealedSectorData,
isUnsealed: false,
isUnsealed: false,
}}
for _, tc := range testCases {
@ -194,7 +194,7 @@ func getPieceStore(t *testing.T) piecestore.PieceStore {
err = ps.Start(context.Background())
require.NoError(t, err)
<- ch
<-ch
return ps
}

View File

@ -91,7 +91,7 @@ func (l *LotusMount) Stat(ctx context.Context) (mount.Stat, error) {
return mount.Stat{
Exists: true,
Size: int64(size),
Ready: isUnsealed,
Ready: isUnsealed,
}, nil
}

View File

@ -92,7 +92,8 @@ func TestWrapperBackground(t *testing.T) {
w.dagStore = mock
// Start up the wrapper
w.Start(ctx)
err = w.Start(ctx)
require.NoError(t, err)
// Expect GC to be called automatically
tctx, cancel := context.WithTimeout(ctx, time.Second)