Skip to content

Commit

Permalink
update init sector state list
Browse files Browse the repository at this point in the history
  • Loading branch information
deaswang committed Sep 17, 2020
1 parent ed74091 commit d5af25b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 34 deletions.
4 changes: 2 additions & 2 deletions cmd/lotus-storage-miner/sectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (

"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/chain/types"

sealing "github.com/filecoin-project/lotus/extern/storage-sealing"

lcli "github.com/filecoin-project/lotus/cli"
sealing "github.com/filecoin-project/lotus/extern/storage-sealing"
)

var sectorsCmd = &cli.Command{
Expand Down
63 changes: 31 additions & 32 deletions extern/storage-sealing/sector_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,37 @@ package sealing

type SectorState string

var ExistSectorStateList = make(map[SectorState]struct{})
var ExistSectorStateList = map[SectorState]struct{}{
Empty: {},
WaitDeals: {},
Packing: {},
PreCommit1: {},
PreCommit2: {},
PreCommitting: {},
PreCommitWait: {},
WaitSeed: {},
Committing: {},
SubmitCommit: {},
CommitWait: {},
FinalizeSector: {},
Proving: {},
FailedUnrecoverable: {},
SealPreCommit1Failed: {},
SealPreCommit2Failed: {},
PreCommitFailed: {},
ComputeProofFailed: {},
CommitFailed: {},
PackingFailed: {},
FinalizeFailed: {},
DealsExpired: {},
RecoverDealIDs: {},
Faulty: {},
FaultReported: {},
FaultedFinal: {},
Removing: {},
RemoveFailed: {},
Removed: {},
}

const (
UndefinedSectorState SectorState = ""
Expand Down Expand Up @@ -41,37 +71,6 @@ const (
RemoveFailed SectorState = "RemoveFailed"
Removed SectorState = "Removed"
)
func init() {
ExistSectorStateList[Empty] = struct{}{}
ExistSectorStateList[WaitDeals] = struct{}{}
ExistSectorStateList[Packing] = struct{}{}
ExistSectorStateList[PreCommit1] = struct{}{}
ExistSectorStateList[PreCommit2] = struct{}{}
ExistSectorStateList[PreCommitting] = struct{}{}
ExistSectorStateList[PreCommitWait] = struct{}{}
ExistSectorStateList[WaitSeed] = struct{}{}
ExistSectorStateList[Committing] = struct{}{}
ExistSectorStateList[SubmitCommit] = struct{}{}
ExistSectorStateList[CommitWait] = struct{}{}
ExistSectorStateList[FinalizeSector] = struct{}{}
ExistSectorStateList[Proving] = struct{}{}
ExistSectorStateList[FailedUnrecoverable] = struct{}{}
ExistSectorStateList[SealPreCommit1Failed] = struct{}{}
ExistSectorStateList[SealPreCommit2Failed] = struct{}{}
ExistSectorStateList[PreCommitFailed] = struct{}{}
ExistSectorStateList[ComputeProofFailed] = struct{}{}
ExistSectorStateList[CommitFailed] = struct{}{}
ExistSectorStateList[PackingFailed] = struct{}{}
ExistSectorStateList[FinalizeFailed] = struct{}{}
ExistSectorStateList[DealsExpired] = struct{}{}
ExistSectorStateList[RecoverDealIDs] = struct{}{}
ExistSectorStateList[Faulty] = struct{}{}
ExistSectorStateList[FaultReported] = struct{}{}
ExistSectorStateList[FaultedFinal] = struct{}{}
ExistSectorStateList[Removing] = struct{}{}
ExistSectorStateList[RemoveFailed] = struct{}{}
ExistSectorStateList[Removed] = struct{}{}
}

func toStatState(st SectorState) statSectorState {
switch st {
Expand Down

0 comments on commit d5af25b

Please sign in to comment.