Merge pull request #3881 from filcloud/issue-3626-SectorState
fix SectorState
This commit is contained in:
commit
7109e95f5e
@ -17,7 +17,9 @@ import (
|
|||||||
|
|
||||||
"github.com/filecoin-project/lotus/api"
|
"github.com/filecoin-project/lotus/api"
|
||||||
"github.com/filecoin-project/lotus/chain/types"
|
"github.com/filecoin-project/lotus/chain/types"
|
||||||
|
|
||||||
lcli "github.com/filecoin-project/lotus/cli"
|
lcli "github.com/filecoin-project/lotus/cli"
|
||||||
|
sealing "github.com/filecoin-project/lotus/extern/storage-sealing"
|
||||||
)
|
)
|
||||||
|
|
||||||
var sectorsCmd = &cli.Command{
|
var sectorsCmd = &cli.Command{
|
||||||
@ -420,6 +422,10 @@ var sectorsUpdateCmd = &cli.Command{
|
|||||||
return xerrors.Errorf("could not parse sector number: %w", err)
|
return xerrors.Errorf("could not parse sector number: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if _, ok := sealing.ExistSectorStateList[sealing.SectorState(cctx.Args().Get(1))]; !ok {
|
||||||
|
return xerrors.Errorf("Not existing sector state")
|
||||||
|
}
|
||||||
|
|
||||||
return nodeApi.SectorsUpdate(ctx, abi.SectorNumber(id), api.SectorState(cctx.Args().Get(1)))
|
return nodeApi.SectorsUpdate(ctx, abi.SectorNumber(id), api.SectorState(cctx.Args().Get(1)))
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
32
extern/storage-sealing/sector_state.go
vendored
32
extern/storage-sealing/sector_state.go
vendored
@ -2,6 +2,38 @@ package sealing
|
|||||||
|
|
||||||
type SectorState string
|
type SectorState string
|
||||||
|
|
||||||
|
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 (
|
const (
|
||||||
UndefinedSectorState SectorState = ""
|
UndefinedSectorState SectorState = ""
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user