9
9
"sync"
10
10
11
11
"github.com/filecoin-project/go-address"
12
+ "github.com/filecoin-project/lotus/storage/pipeline/piece"
12
13
13
14
pdtypes "github.com/filecoin-project/boost/piecedirectory/types"
14
15
mock_piecedirectory "github.com/filecoin-project/boost/piecedirectory/types/mocks"
@@ -18,7 +19,6 @@ import (
18
19
"github.com/filecoin-project/boost/testutil"
19
20
"github.com/filecoin-project/go-state-types/abi"
20
21
"github.com/filecoin-project/go-state-types/builtin/v9/market"
21
- "github.com/filecoin-project/lotus/api"
22
22
lapi "github.com/filecoin-project/lotus/api"
23
23
sealing "github.com/filecoin-project/lotus/storage/pipeline"
24
24
"github.com/golang/mock/gomock"
@@ -138,7 +138,7 @@ func (mb *MinerStubBuilder) SetupNoOp() *MinerStubBuilder {
138
138
}, nil
139
139
}).AnyTimes ()
140
140
141
- mb .stub .MockPieceAdder .EXPECT ().AddPiece (gomock .Any (), gomock .Eq (mb .dp .ClientDealProposal .Proposal .PieceSize .Unpadded ()), gomock .Any (), gomock .Any ()).DoAndReturn (func (_ context.Context , _ abi.UnpaddedPieceSize , r io.Reader , _ api .PieceDealInfo ) (abi.SectorNumber , abi.PaddedPieceSize , error ) {
141
+ mb .stub .MockPieceAdder .EXPECT ().SectorAddPieceToAny (gomock .Any (), gomock .Eq (mb .dp .ClientDealProposal .Proposal .PieceSize .Unpadded ()), gomock .Any (), gomock .Any ()).DoAndReturn (func (_ context.Context , _ abi.UnpaddedPieceSize , r io.Reader , _ piece .PieceDealInfo ) (abi.SectorNumber , abi.PaddedPieceSize , error ) {
142
142
return mb .sectorId , mb .offset , nil
143
143
}).AnyTimes ()
144
144
@@ -293,7 +293,7 @@ func (mb *MinerStubBuilder) SetupAddPiece(blocking bool) *MinerStubBuilder {
293
293
}
294
294
295
295
var readBytes []byte
296
- mb .stub .MockPieceAdder .EXPECT ().AddPiece (gomock .Any (), gomock .Eq (mb .dp .ClientDealProposal .Proposal .PieceSize .Unpadded ()), gomock .Any (), gomock .Eq (sdInfo )).DoAndReturn (func (ctx context.Context , _ abi.UnpaddedPieceSize , r io.Reader , _ api .PieceDealInfo ) (abi.SectorNumber , abi.PaddedPieceSize , error ) {
296
+ mb .stub .MockPieceAdder .EXPECT ().SectorAddPieceToAny (gomock .Any (), gomock .Eq (mb .dp .ClientDealProposal .Proposal .PieceSize .Unpadded ()), gomock .Any (), gomock .Eq (sdInfo )).DoAndReturn (func (ctx context.Context , _ abi.UnpaddedPieceSize , r io.Reader , _ piece .PieceDealInfo ) (abi.SectorNumber , abi.PaddedPieceSize , error ) {
297
297
mb .stub .lk .Lock ()
298
298
ch := mb .stub .unblockAddPiece [mb .dp .DealUUID ]
299
299
mb .stub .lk .Unlock ()
@@ -330,7 +330,7 @@ func (mb *MinerStubBuilder) SetupAddPieceFailure(err error) {
330
330
KeepUnsealed : ! mb .dp .RemoveUnsealedCopy ,
331
331
}
332
332
333
- mb .stub .MockPieceAdder .EXPECT ().AddPiece (gomock .Any (), gomock .Eq (mb .dp .ClientDealProposal .Proposal .PieceSize .Unpadded ()), gomock .Any (), gomock .Eq (sdInfo )).DoAndReturn (func (_ context.Context , _ abi.UnpaddedPieceSize , r io.Reader , _ api .PieceDealInfo ) (abi.SectorNumber , abi.PaddedPieceSize , error ) {
333
+ mb .stub .MockPieceAdder .EXPECT ().SectorAddPieceToAny (gomock .Any (), gomock .Eq (mb .dp .ClientDealProposal .Proposal .PieceSize .Unpadded ()), gomock .Any (), gomock .Eq (sdInfo )).DoAndReturn (func (_ context.Context , _ abi.UnpaddedPieceSize , r io.Reader , _ piece .PieceDealInfo ) (abi.SectorNumber , abi.PaddedPieceSize , error ) {
334
334
return abi .SectorNumber (0 ), abi .PaddedPieceSize (0 ), err
335
335
})
336
336
}
0 commit comments