Skip to content

Commit

Permalink
chore: Fix more imports with '2' suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Jun 14, 2022
1 parent 7864e14 commit bf192d0
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 76 deletions.
10 changes: 5 additions & 5 deletions cmd/lotus-miner/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand All @@ -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),
Expand Down
28 changes: 14 additions & 14 deletions conformance/chaos/actor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down
22 changes: 11 additions & 11 deletions itests/kit/ensemble.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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),
)
}

Expand Down Expand Up @@ -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)),
)
}
Expand Down
16 changes: 8 additions & 8 deletions markets/storageadapter/ondealsectorcommitted.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ 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 {
Called(ctx context.Context, check events.CheckFunc, msgHnd events.MsgHandler, rev events.RevertHandler, confidence int, timeout abi.ChainEpoch, mf events.MsgMatchFunc) error
}

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 {
Expand All @@ -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)
}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit bf192d0

Please sign in to comment.