fix lint errors.
This commit is contained in:
parent
2e30891005
commit
932767d014
@ -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)
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user