chore: Fix more imports with '2' suffix

This commit is contained in:
Łukasz Magiera 2022-06-14 21:23:17 +02:00
parent 7864e1470e
commit 39cede946c
10 changed files with 91 additions and 91 deletions

View File

@ -55,7 +55,7 @@ import (
"github.com/filecoin-project/lotus/node/repo"
"github.com/filecoin-project/lotus/storage"
"github.com/filecoin-project/lotus/storage/paths"
sealing2 "github.com/filecoin-project/lotus/storage/pipeline"
pipeline "github.com/filecoin-project/lotus/storage/pipeline"
"github.com/filecoin-project/lotus/storage/sealer"
"github.com/filecoin-project/lotus/storage/sealer/ffiwrapper"
"github.com/filecoin-project/lotus/storage/sealer/storiface"
@ -303,7 +303,7 @@ func migratePreSealMeta(ctx context.Context, api v1api.FullNode, metadata string
maxSectorID := abi.SectorNumber(0)
for _, sector := range meta.Sectors {
sectorKey := datastore.NewKey(sealing2.SectorStorePrefix).ChildString(fmt.Sprint(sector.SectorID))
sectorKey := datastore.NewKey(pipeline.SectorStorePrefix).ChildString(fmt.Sprint(sector.SectorID))
dealID, err := findMarketDealID(ctx, api, sector.Deal)
if err != nil {
@ -312,10 +312,10 @@ func migratePreSealMeta(ctx context.Context, api v1api.FullNode, metadata string
commD := sector.CommD
commR := sector.CommR
info := &sealing2.SectorInfo{
State: sealing2.Proving,
info := &pipeline.SectorInfo{
State: pipeline.Proving,
SectorNumber: sector.SectorID,
Pieces: []sealing2.Piece{
Pieces: []pipeline.Piece{
{
Piece: abi.PieceInfo{
Size: abi.PaddedPieceSize(meta.SectorSize),

View File

@ -11,14 +11,14 @@ import (
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/exitcode"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
mock2 "github.com/filecoin-project/specs-actors/v2/support/mock"
mock "github.com/filecoin-project/specs-actors/v2/support/mock"
atesting2 "github.com/filecoin-project/specs-actors/v2/support/testing"
)
func TestSingleton(t *testing.T) {
//stm: @CHAIN_ACTOR_CHAOS_BUILDER_001
receiver := atesting2.NewIDAddr(t, 100)
builder := mock2.NewBuilder(context.Background(), receiver)
builder := mock.NewBuilder(context.Background(), receiver)
rt := builder.Build(t)
var a Actor
@ -33,7 +33,7 @@ func TestSingleton(t *testing.T) {
func TestCallerValidationNone(t *testing.T) {
//stm: @CHAIN_ACTOR_CHAOS_CALLER_VALIDATION_001
receiver := atesting2.NewIDAddr(t, 100)
builder := mock2.NewBuilder(context.Background(), receiver)
builder := mock.NewBuilder(context.Background(), receiver)
rt := builder.Build(t)
var a Actor
@ -46,7 +46,7 @@ func TestCallerValidationIs(t *testing.T) {
//stm: @CHAIN_ACTOR_CHAOS_CALLER_VALIDATION_001
caller := atesting2.NewIDAddr(t, 100)
receiver := atesting2.NewIDAddr(t, 101)
builder := mock2.NewBuilder(context.Background(), receiver)
builder := mock.NewBuilder(context.Background(), receiver)
rt := builder.Build(t)
rt.SetCaller(caller, builtin2.AccountActorCodeID)
@ -76,7 +76,7 @@ func TestCallerValidationType(t *testing.T) {
//stm: @CHAIN_ACTOR_CHAOS_CALLER_VALIDATION_001
caller := atesting2.NewIDAddr(t, 100)
receiver := atesting2.NewIDAddr(t, 101)
builder := mock2.NewBuilder(context.Background(), receiver)
builder := mock.NewBuilder(context.Background(), receiver)
rt := builder.Build(t)
rt.SetCaller(caller, builtin2.AccountActorCodeID)
@ -102,7 +102,7 @@ func TestCallerValidationType(t *testing.T) {
func TestCallerValidationInvalidBranch(t *testing.T) {
//stm: @CHAIN_ACTOR_CHAOS_CALLER_VALIDATION_001
receiver := atesting2.NewIDAddr(t, 100)
builder := mock2.NewBuilder(context.Background(), receiver)
builder := mock.NewBuilder(context.Background(), receiver)
rt := builder.Build(t)
var a Actor
@ -117,7 +117,7 @@ func TestDeleteActor(t *testing.T) {
//stm: @CHAIN_ACTOR_CHAOS_CREATE_ACTOR_001
receiver := atesting2.NewIDAddr(t, 100)
beneficiary := atesting2.NewIDAddr(t, 101)
builder := mock2.NewBuilder(context.Background(), receiver)
builder := mock.NewBuilder(context.Background(), receiver)
rt := builder.Build(t)
var a Actor
@ -131,7 +131,7 @@ func TestDeleteActor(t *testing.T) {
func TestMutateStateInTransaction(t *testing.T) {
//stm: @CHAIN_ACTOR_CHAOS_CREATE_STATE_001, @CHAIN_ACTOR_CHAOS_MUTATE_STATE_001
receiver := atesting2.NewIDAddr(t, 100)
builder := mock2.NewBuilder(context.Background(), receiver)
builder := mock.NewBuilder(context.Background(), receiver)
rt := builder.Build(t)
var a Actor
@ -159,7 +159,7 @@ func TestMutateStateInTransaction(t *testing.T) {
func TestMutateStateAfterTransaction(t *testing.T) {
//stm: @CHAIN_ACTOR_CHAOS_CREATE_STATE_001, @CHAIN_ACTOR_CHAOS_MUTATE_STATE_001
receiver := atesting2.NewIDAddr(t, 100)
builder := mock2.NewBuilder(context.Background(), receiver)
builder := mock.NewBuilder(context.Background(), receiver)
rt := builder.Build(t)
var a Actor
@ -194,7 +194,7 @@ func TestMutateStateAfterTransaction(t *testing.T) {
func TestMutateStateReadonly(t *testing.T) {
//stm: @CHAIN_ACTOR_CHAOS_CREATE_STATE_001, @CHAIN_ACTOR_CHAOS_MUTATE_STATE_001
receiver := atesting2.NewIDAddr(t, 100)
builder := mock2.NewBuilder(context.Background(), receiver)
builder := mock.NewBuilder(context.Background(), receiver)
rt := builder.Build(t)
var a Actor
@ -229,7 +229,7 @@ func TestMutateStateReadonly(t *testing.T) {
func TestMutateStateInvalidBranch(t *testing.T) {
//stm: @CHAIN_ACTOR_CHAOS_MUTATE_STATE_001
receiver := atesting2.NewIDAddr(t, 100)
builder := mock2.NewBuilder(context.Background(), receiver)
builder := mock.NewBuilder(context.Background(), receiver)
rt := builder.Build(t)
var a Actor
@ -244,7 +244,7 @@ func TestMutateStateInvalidBranch(t *testing.T) {
func TestAbortWith(t *testing.T) {
//stm: @CHAIN_ACTOR_CHAOS_ABORT_WITH_001
receiver := atesting2.NewIDAddr(t, 100)
builder := mock2.NewBuilder(context.Background(), receiver)
builder := mock.NewBuilder(context.Background(), receiver)
rt := builder.Build(t)
var a Actor
@ -263,7 +263,7 @@ func TestAbortWith(t *testing.T) {
func TestAbortWithUncontrolled(t *testing.T) {
//stm: @CHAIN_ACTOR_CHAOS_ABORT_WITH_001
receiver := atesting2.NewIDAddr(t, 100)
builder := mock2.NewBuilder(context.Background(), receiver)
builder := mock.NewBuilder(context.Background(), receiver)
rt := builder.Build(t)
var a Actor
@ -282,7 +282,7 @@ func TestInspectRuntime(t *testing.T) {
//stm: @CHAIN_ACTOR_CHAOS_INSPECT_RUNTIME_001, @CHAIN_ACTOR_CHAOS_CREATE_STATE_001
caller := atesting2.NewIDAddr(t, 100)
receiver := atesting2.NewIDAddr(t, 101)
builder := mock2.NewBuilder(context.Background(), receiver)
builder := mock.NewBuilder(context.Background(), receiver)
var a Actor

View File

@ -58,7 +58,7 @@ import (
"github.com/filecoin-project/lotus/storage/paths"
sectorstorage "github.com/filecoin-project/lotus/storage/sealer"
"github.com/filecoin-project/lotus/storage/sealer/ffiwrapper"
mock2 "github.com/filecoin-project/lotus/storage/sealer/mock"
mock "github.com/filecoin-project/lotus/storage/sealer/mock"
)
func init() {
@ -246,7 +246,7 @@ func (n *Ensemble) Miner(minerNode *TestMiner, full *TestFullNode, opts ...NodeO
// Create the preseal commitment.
if n.options.mockProofs {
genm, k, err = mock2.PreSeal(proofType, actorAddr, sectors)
genm, k, err = mock.PreSeal(proofType, actorAddr, sectors)
} else {
genm, k, err = seed.PreSeal(actorAddr, proofType, 0, sectors, tdir, []byte("make genesis mem random"), nil, true)
}
@ -363,8 +363,8 @@ func (n *Ensemble) Start() *Ensemble {
// Are we mocking proofs?
if n.options.mockProofs {
opts = append(opts,
node.Override(new(ffiwrapper.Verifier), mock2.MockVerifier),
node.Override(new(ffiwrapper.Prover), mock2.MockProver),
node.Override(new(ffiwrapper.Verifier), mock.MockVerifier),
node.Override(new(ffiwrapper.Prover), mock.MockProver),
)
}
@ -636,15 +636,15 @@ func (n *Ensemble) Start() *Ensemble {
if n.options.mockProofs {
opts = append(opts,
node.Override(new(*mock2.SectorMgr), func() (*mock2.SectorMgr, error) {
return mock2.NewMockSectorMgr(presealSectors), nil
node.Override(new(*mock.SectorMgr), func() (*mock.SectorMgr, error) {
return mock.NewMockSectorMgr(presealSectors), nil
}),
node.Override(new(sectorstorage.SectorManager), node.From(new(*mock2.SectorMgr))),
node.Override(new(sectorstorage.Unsealer), node.From(new(*mock2.SectorMgr))),
node.Override(new(sectorstorage.PieceProvider), node.From(new(*mock2.SectorMgr))),
node.Override(new(sectorstorage.SectorManager), node.From(new(*mock.SectorMgr))),
node.Override(new(sectorstorage.Unsealer), node.From(new(*mock.SectorMgr))),
node.Override(new(sectorstorage.PieceProvider), node.From(new(*mock.SectorMgr))),
node.Override(new(ffiwrapper.Verifier), mock2.MockVerifier),
node.Override(new(ffiwrapper.Prover), mock2.MockProver),
node.Override(new(ffiwrapper.Verifier), mock.MockVerifier),
node.Override(new(ffiwrapper.Prover), mock.MockProver),
node.Unset(new(*sectorstorage.Manager)),
)
}

View File

@ -20,7 +20,7 @@ import (
lminer "github.com/filecoin-project/lotus/chain/actors/builtin/miner"
"github.com/filecoin-project/lotus/chain/events"
"github.com/filecoin-project/lotus/chain/types"
sealing2 "github.com/filecoin-project/lotus/storage/pipeline"
pipeline "github.com/filecoin-project/lotus/storage/pipeline"
)
type eventsCalledAPI interface {
@ -28,7 +28,7 @@ type eventsCalledAPI interface {
}
type dealInfoAPI interface {
GetCurrentDealInfo(ctx context.Context, tok sealing2.TipSetToken, proposal *market.DealProposal, publishCid cid.Cid) (sealing2.CurrentDealInfo, error)
GetCurrentDealInfo(ctx context.Context, tok pipeline.TipSetToken, proposal *market.DealProposal, publishCid cid.Cid) (pipeline.CurrentDealInfo, error)
}
type diffPreCommitsAPI interface {
@ -41,9 +41,9 @@ type SectorCommittedManager struct {
dpc diffPreCommitsAPI
}
func NewSectorCommittedManager(ev eventsCalledAPI, tskAPI sealing2.CurrentDealInfoTskAPI, dpcAPI diffPreCommitsAPI) *SectorCommittedManager {
dim := &sealing2.CurrentDealInfoManager{
CDAPI: &sealing2.CurrentDealInfoAPIAdapter{CurrentDealInfoTskAPI: tskAPI},
func NewSectorCommittedManager(ev eventsCalledAPI, tskAPI pipeline.CurrentDealInfoTskAPI, dpcAPI diffPreCommitsAPI) *SectorCommittedManager {
dim := &pipeline.CurrentDealInfoManager{
CDAPI: &pipeline.CurrentDealInfoAPIAdapter{CurrentDealInfoTskAPI: tskAPI},
}
return newSectorCommittedManager(ev, dim, dpcAPI)
}
@ -280,7 +280,7 @@ func (mgr *SectorCommittedManager) OnDealSectorCommitted(ctx context.Context, pr
return nil
}
func dealSectorInReplicaUpdateSuccess(msg *types.Message, rec *types.MessageReceipt, res sealing2.CurrentDealInfo) (*abi.SectorNumber, error) {
func dealSectorInReplicaUpdateSuccess(msg *types.Message, rec *types.MessageReceipt, res pipeline.CurrentDealInfo) (*abi.SectorNumber, error) {
var params miner.ProveReplicaUpdatesParams
if err := params.UnmarshalCBOR(bytes.NewReader(msg.Params)); err != nil {
return nil, xerrors.Errorf("unmarshal prove replica update: %w", err)
@ -317,7 +317,7 @@ func dealSectorInReplicaUpdateSuccess(msg *types.Message, rec *types.MessageRece
}
// dealSectorInPreCommitMsg tries to find a sector containing the specified deal
func dealSectorInPreCommitMsg(msg *types.Message, res sealing2.CurrentDealInfo) (*abi.SectorNumber, error) {
func dealSectorInPreCommitMsg(msg *types.Message, res pipeline.CurrentDealInfo) (*abi.SectorNumber, error) {
switch msg.Method {
case builtin.MethodsMiner.PreCommitSector:
var params miner.SectorPreCommitInfo
@ -383,7 +383,7 @@ func sectorInCommitMsg(msg *types.Message, sectorNumber abi.SectorNumber) (bool,
}
}
func (mgr *SectorCommittedManager) checkIfDealAlreadyActive(ctx context.Context, ts *types.TipSet, proposal *market.DealProposal, publishCid cid.Cid) (sealing2.CurrentDealInfo, bool, error) {
func (mgr *SectorCommittedManager) checkIfDealAlreadyActive(ctx context.Context, ts *types.TipSet, proposal *market.DealProposal, publishCid cid.Cid) (pipeline.CurrentDealInfo, bool, error) {
res, err := mgr.dealInfo.GetCurrentDealInfo(ctx, ts.Key().Bytes(), proposal, publishCid)
if err != nil {
// TODO: This may be fine for some errors

View File

@ -29,7 +29,7 @@ import (
"github.com/filecoin-project/lotus/chain/events"
test "github.com/filecoin-project/lotus/chain/events/state/mock"
"github.com/filecoin-project/lotus/chain/types"
sealing2 "github.com/filecoin-project/lotus/storage/pipeline"
pipeline "github.com/filecoin-project/lotus/storage/pipeline"
)
func TestOnDealSectorPreCommitted(t *testing.T) {
@ -76,7 +76,7 @@ func TestOnDealSectorPreCommitted(t *testing.T) {
},
}
type testCase struct {
currentDealInfo sealing2.CurrentDealInfo
currentDealInfo pipeline.CurrentDealInfo
currentDealInfoErr error
currentDealInfoErr2 error
preCommitDiff *miner.PreCommitChanges
@ -90,7 +90,7 @@ func TestOnDealSectorPreCommitted(t *testing.T) {
}
testCases := map[string]testCase{
"normal sequence": {
currentDealInfo: sealing2.CurrentDealInfo{
currentDealInfo: pipeline.CurrentDealInfo{
DealID: dealID,
MarketDeal: unfinishedDeal,
},
@ -108,7 +108,7 @@ func TestOnDealSectorPreCommitted(t *testing.T) {
expectedCBSectorNumber: sectorNumber,
},
"ignores unsuccessful pre-commit message": {
currentDealInfo: sealing2.CurrentDealInfo{
currentDealInfo: pipeline.CurrentDealInfo{
DealID: dealID,
MarketDeal: unfinishedDeal,
},
@ -126,7 +126,7 @@ func TestOnDealSectorPreCommitted(t *testing.T) {
expectedCBCallCount: 0,
},
"deal already pre-committed": {
currentDealInfo: sealing2.CurrentDealInfo{
currentDealInfo: pipeline.CurrentDealInfo{
DealID: dealID,
MarketDeal: unfinishedDeal,
},
@ -148,7 +148,7 @@ func TestOnDealSectorPreCommitted(t *testing.T) {
expectedError: xerrors.Errorf("failed to set up called handler: failed to look up deal on chain: something went wrong"),
},
"sector already active": {
currentDealInfo: sealing2.CurrentDealInfo{
currentDealInfo: pipeline.CurrentDealInfo{
DealID: dealID,
MarketDeal: activeDeal,
},
@ -156,7 +156,7 @@ func TestOnDealSectorPreCommitted(t *testing.T) {
expectedCBIsActive: true,
},
"sector was slashed": {
currentDealInfo: sealing2.CurrentDealInfo{
currentDealInfo: pipeline.CurrentDealInfo{
DealID: dealID,
MarketDeal: slashedDeal,
PublishMsgTipSet: nil,
@ -165,7 +165,7 @@ func TestOnDealSectorPreCommitted(t *testing.T) {
expectedError: xerrors.Errorf("failed to set up called handler: deal %d was slashed at epoch %d", dealID, slashedDeal.State.SlashEpoch),
},
"error getting current deal info in called func": {
currentDealInfo: sealing2.CurrentDealInfo{
currentDealInfo: pipeline.CurrentDealInfo{
DealID: dealID,
MarketDeal: unfinishedDeal,
},
@ -183,7 +183,7 @@ func TestOnDealSectorPreCommitted(t *testing.T) {
expectedCBError: errors.New("handling applied event: something went wrong"),
},
"proposed deal epoch timeout": {
currentDealInfo: sealing2.CurrentDealInfo{
currentDealInfo: pipeline.CurrentDealInfo{
DealID: dealID,
MarketDeal: activeDeal,
},
@ -298,9 +298,9 @@ func TestOnDealSectorCommitted(t *testing.T) {
},
}
type testCase struct {
currentDealInfo sealing2.CurrentDealInfo
currentDealInfo pipeline.CurrentDealInfo
currentDealInfoErr error
currentDealInfo2 sealing2.CurrentDealInfo
currentDealInfo2 pipeline.CurrentDealInfo
currentDealInfoErr2 error
matchStates []matchState
dealStartEpochTimeout bool
@ -310,11 +310,11 @@ func TestOnDealSectorCommitted(t *testing.T) {
}
testCases := map[string]testCase{
"normal sequence": {
currentDealInfo: sealing2.CurrentDealInfo{
currentDealInfo: pipeline.CurrentDealInfo{
DealID: dealID,
MarketDeal: unfinishedDeal,
},
currentDealInfo2: sealing2.CurrentDealInfo{
currentDealInfo2: pipeline.CurrentDealInfo{
DealID: dealID,
MarketDeal: activeDeal,
},
@ -328,11 +328,11 @@ func TestOnDealSectorCommitted(t *testing.T) {
expectedCBCallCount: 1,
},
"ignores unsuccessful prove-commit message": {
currentDealInfo: sealing2.CurrentDealInfo{
currentDealInfo: pipeline.CurrentDealInfo{
DealID: dealID,
MarketDeal: unfinishedDeal,
},
currentDealInfo2: sealing2.CurrentDealInfo{
currentDealInfo2: pipeline.CurrentDealInfo{
DealID: dealID,
MarketDeal: activeDeal,
},
@ -353,14 +353,14 @@ func TestOnDealSectorCommitted(t *testing.T) {
expectedError: xerrors.Errorf("failed to set up called handler: failed to look up deal on chain: something went wrong"),
},
"sector already active": {
currentDealInfo: sealing2.CurrentDealInfo{
currentDealInfo: pipeline.CurrentDealInfo{
DealID: dealID,
MarketDeal: activeDeal,
},
expectedCBCallCount: 1,
},
"sector was slashed": {
currentDealInfo: sealing2.CurrentDealInfo{
currentDealInfo: pipeline.CurrentDealInfo{
DealID: dealID,
MarketDeal: slashedDeal,
},
@ -368,7 +368,7 @@ func TestOnDealSectorCommitted(t *testing.T) {
expectedError: xerrors.Errorf("failed to set up called handler: deal %d was slashed at epoch %d", dealID, slashedDeal.State.SlashEpoch),
},
"error getting current deal info in called func": {
currentDealInfo: sealing2.CurrentDealInfo{
currentDealInfo: pipeline.CurrentDealInfo{
DealID: dealID,
MarketDeal: unfinishedDeal,
},
@ -384,7 +384,7 @@ func TestOnDealSectorCommitted(t *testing.T) {
expectedCBError: xerrors.Errorf("handling applied event: failed to look up deal on chain: something went wrong"),
},
"proposed deal epoch timeout": {
currentDealInfo: sealing2.CurrentDealInfo{
currentDealInfo: pipeline.CurrentDealInfo{
DealID: dealID,
MarketDeal: unfinishedDeal,
},
@ -393,11 +393,11 @@ func TestOnDealSectorCommitted(t *testing.T) {
expectedCBError: xerrors.Errorf("handling applied event: deal with piece CID %s was not activated by proposed deal start epoch 0", unfinishedDeal.Proposal.PieceCID),
},
"got prove-commit but deal not active": {
currentDealInfo: sealing2.CurrentDealInfo{
currentDealInfo: pipeline.CurrentDealInfo{
DealID: dealID,
MarketDeal: unfinishedDeal,
},
currentDealInfo2: sealing2.CurrentDealInfo{
currentDealInfo2: pipeline.CurrentDealInfo{
DealID: dealID,
MarketDeal: unfinishedDeal,
},
@ -568,13 +568,13 @@ func (m *mockPreCommitsAPI) diffPreCommits(ctx context.Context, actor address.Ad
type mockDealInfoAPI struct {
count int
CurrentDealInfo sealing2.CurrentDealInfo
CurrentDealInfo pipeline.CurrentDealInfo
Err error
CurrentDealInfo2 sealing2.CurrentDealInfo
CurrentDealInfo2 pipeline.CurrentDealInfo
Err2 error
}
func (m *mockDealInfoAPI) GetCurrentDealInfo(ctx context.Context, tok sealing2.TipSetToken, proposal *market.DealProposal, publishCid cid.Cid) (sealing2.CurrentDealInfo, error) {
func (m *mockDealInfoAPI) GetCurrentDealInfo(ctx context.Context, tok pipeline.TipSetToken, proposal *market.DealProposal, publishCid cid.Cid) (pipeline.CurrentDealInfo, error) {
m.count++
if m.count == 2 {
return m.CurrentDealInfo2, m.Err2

View File

@ -31,7 +31,7 @@ import (
"github.com/filecoin-project/lotus/markets/utils"
"github.com/filecoin-project/lotus/node/config"
"github.com/filecoin-project/lotus/node/modules/helpers"
sealing2 "github.com/filecoin-project/lotus/storage/pipeline"
pipeline "github.com/filecoin-project/lotus/storage/pipeline"
"github.com/filecoin-project/lotus/storage/sectorblocks"
)
@ -108,7 +108,7 @@ func (n *ProviderNodeAdapter) OnDealComplete(ctx context.Context, deal storagema
curTime := build.Clock.Now()
for build.Clock.Since(curTime) < addPieceRetryTimeout {
// Check if there was an error because of too many sectors being sealed
if !xerrors.Is(err, sealing2.ErrTooManySectorsSealing) {
if !xerrors.Is(err, pipeline.ErrTooManySectorsSealing) {
if err != nil {
log.Errorf("failed to addPiece for deal %d, err: %v", deal.DealID, err)
}
@ -258,13 +258,13 @@ func (n *ProviderNodeAdapter) LocatePieceForDealWithinSector(ctx context.Context
if err != nil {
return 0, 0, 0, xerrors.Errorf("getting sector info: %w", err)
}
if si.State == api.SectorState(sealing2.Proving) {
if si.State == api.SectorState(pipeline.Proving) {
best = r
bestSi = si
break
}
}
if bestSi.State == api.SectorState(sealing2.UndefinedSectorState) {
if bestSi.State == api.SectorState(pipeline.UndefinedSectorState) {
return 0, 0, 0, xerrors.New("no sealed sector found")
}
return best.SectorID, best.Offset, best.Size.Padded(), nil

View File

@ -529,8 +529,8 @@ func TestPaychGetRestartAfterCreateChannelMsg(t *testing.T) {
mock.close()
// Create a new manager with the same datastore
mock2 := newMockManagerAPI()
defer mock2.close()
mock := newMockManagerAPI()
defer mock.close()
act := &types.Actor{
Code: builtin.AccountActorCodeID,
@ -538,9 +538,9 @@ func TestPaychGetRestartAfterCreateChannelMsg(t *testing.T) {
Nonce: 0,
Balance: types.NewInt(20),
}
mock2.setPaychState(ch, act, paychmock.NewMockPayChState(from, to, abi.ChainEpoch(0), make(map[uint64]paych.LaneState)))
mock.setPaychState(ch, act, paychmock.NewMockPayChState(from, to, abi.ChainEpoch(0), make(map[uint64]paych.LaneState)))
mgr2, err := newManager(store, mock2)
mgr2, err := newManager(store, mock)
require.NoError(t, err)
// Should have no channels yet (message sent but channel not created)
@ -586,7 +586,7 @@ func TestPaychGetRestartAfterCreateChannelMsg(t *testing.T) {
}()
// 3. Send create channel response
mock2.receiveMsgResponse(createMsgCid, response)
mock.receiveMsgResponse(createMsgCid, response)
<-done
}
@ -634,16 +634,16 @@ func TestPaychGetRestartAfterAddFundsMsg(t *testing.T) {
require.NoError(t, mgr.Stop())
// Create a new manager with the same datastore
mock2 := newMockManagerAPI()
defer mock2.close()
mock := newMockManagerAPI()
defer mock.close()
mock2.setPaychState(ch, act, paychmock.NewMockPayChState(from, to, abi.ChainEpoch(0), make(map[uint64]paych.LaneState)))
mock.setPaychState(ch, act, paychmock.NewMockPayChState(from, to, abi.ChainEpoch(0), make(map[uint64]paych.LaneState)))
mgr2, err := newManager(store, mock2)
mgr2, err := newManager(store, mock)
require.NoError(t, err)
// Send success add funds response
mock2.receiveMsgResponse(mcid2, types.MessageReceipt{
mock.receiveMsgResponse(mcid2, types.MessageReceipt{
ExitCode: 0,
Return: []byte{},
})

View File

@ -30,7 +30,7 @@ import (
"github.com/filecoin-project/lotus/lib/nullreader"
nr "github.com/filecoin-project/lotus/storage/pipeline/lib/nullreader"
fr322 "github.com/filecoin-project/lotus/storage/sealer/fr32"
fr32 "github.com/filecoin-project/lotus/storage/sealer/fr32"
"github.com/filecoin-project/lotus/storage/sealer/partialfile"
storiface "github.com/filecoin-project/lotus/storage/sealer/storiface"
)
@ -237,7 +237,7 @@ func (sb *Sealer) AddPiece(ctx context.Context, sector storage.SectorRef, existi
return abi.PieceInfo{}, xerrors.Errorf("getting partial file writer: %w", err)
}
pw := fr322.NewPadWriter(w)
pw := fr32.NewPadWriter(w)
pr := io.TeeReader(io.LimitReader(file, int64(pieceSize)), pw)
@ -537,11 +537,11 @@ func (sb *Sealer) UnsealPiece(ctx context.Context, sector storage.SectorRef, off
defer close(outWait)
defer opr.Close() // nolint
padwriter := fr322.NewPadWriter(out)
padwriter := fr32.NewPadWriter(out)
bsize := uint64(size.Padded())
if bsize > uint64(runtime.NumCPU())*fr322.MTTresh {
bsize = uint64(runtime.NumCPU()) * fr322.MTTresh
if bsize > uint64(runtime.NumCPU())*fr32.MTTresh {
bsize = uint64(runtime.NumCPU()) * fr32.MTTresh
}
bw := bufio.NewWriterSize(padwriter, int(abi.PaddedPieceSize(bsize).Unpadded()))
@ -644,7 +644,7 @@ func (sb *Sealer) ReadPiece(ctx context.Context, writer io.Writer, sector storag
return false, xerrors.Errorf("getting partial file reader: %w", err)
}
upr, err := fr322.NewUnpadReader(f, size.Padded())
upr, err := fr32.NewUnpadReader(f, size.Padded())
if err != nil {
return false, xerrors.Errorf("creating unpadded reader: %w", err)
}

View File

@ -10,7 +10,7 @@ import (
"github.com/filecoin-project/go-state-types/abi"
fr322 "github.com/filecoin-project/lotus/storage/sealer/fr32"
fr32 "github.com/filecoin-project/lotus/storage/sealer/fr32"
)
func TestUnpadReader(t *testing.T) {
@ -19,9 +19,9 @@ func TestUnpadReader(t *testing.T) {
raw := bytes.Repeat([]byte{0x77}, int(ps))
padOut := make([]byte, ps.Padded())
fr322.Pad(raw, padOut)
fr32.Pad(raw, padOut)
r, err := fr322.NewUnpadReader(bytes.NewReader(padOut), ps.Padded())
r, err := fr32.NewUnpadReader(bytes.NewReader(padOut), ps.Padded())
if err != nil {
t.Fatal(err)
}

View File

@ -15,13 +15,13 @@ import (
"golang.org/x/xerrors"
"github.com/filecoin-project/dagstore/mount"
ffiwrapper "github.com/filecoin-project/go-commp-utils/ffiwrapper"
commpffi "github.com/filecoin-project/go-commp-utils/ffiwrapper"
commcid "github.com/filecoin-project/go-fil-commcid"
"github.com/filecoin-project/go-state-types/abi"
prooftypes "github.com/filecoin-project/go-state-types/proof"
"github.com/filecoin-project/specs-storage/storage"
ffiwrapper3 "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper"
ffiwrapper "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper"
storiface "github.com/filecoin-project/lotus/storage/sealer/storiface"
)
@ -90,7 +90,7 @@ func (mgr *SectorMgr) AddPiece(ctx context.Context, sectorID storage.SectorRef,
var b bytes.Buffer
tr := io.TeeReader(r, &b)
c, err := ffiwrapper.GeneratePieceCIDFromFile(sectorID.ProofType, tr, size)
c, err := commpffi.GeneratePieceCIDFromFile(sectorID.ProofType, tr, size)
if err != nil {
return abi.PieceInfo{}, xerrors.Errorf("failed to generate piece cid: %w", err)
}
@ -722,7 +722,7 @@ func (m mockVerifProver) VerifyWindowPoSt(ctx context.Context, info prooftypes.W
}
func (m mockVerifProver) GenerateDataCommitment(pt abi.RegisteredSealProof, pieces []abi.PieceInfo) (cid.Cid, error) {
return ffiwrapper3.GenerateUnsealedCID(pt, pieces)
return ffiwrapper.GenerateUnsealedCID(pt, pieces)
}
func (m mockVerifProver) GenerateWinningPoStSectorChallenge(ctx context.Context, proofType abi.RegisteredPoStProof, minerID abi.ActorID, randomness abi.PoStRandomness, eligibleSectorCount uint64) ([]uint64, error) {
@ -736,5 +736,5 @@ var MockVerifier = mockVerifProver{
var MockProver = MockVerifier
var _ storage.Sealer = &SectorMgr{}
var _ ffiwrapper3.Verifier = MockVerifier
var _ ffiwrapper3.Prover = MockProver
var _ ffiwrapper.Verifier = MockVerifier
var _ ffiwrapper.Prover = MockProver