Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

Commit

Permalink
Fix bugs (#143)
Browse files Browse the repository at this point in the history
* Fix the bug of SetConfig exception

* Missing some color schemes for sector status
  • Loading branch information
wenxinnnnn authored and hunjixin committed Dec 7, 2021
1 parent 9dcb914 commit a1c05e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions app/venus-sealer/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ var stateList = []stateMeta{

{col: color.FgBlue, state: types.Empty},
{col: color.FgBlue, state: types.WaitDeals},
{col: color.FgBlue, state: types.AddPiece},

{col: color.FgRed, state: types.UndefinedSectorState},
{col: color.FgYellow, state: types.Packing},
Expand All @@ -96,10 +97,15 @@ var stateList = []stateMeta{
{col: color.FgYellow, state: types.PreCommit2},
{col: color.FgYellow, state: types.PreCommitting},
{col: color.FgYellow, state: types.PreCommitWait},
{col: color.FgYellow, state: types.SubmitPreCommitBatch},
{col: color.FgYellow, state: types.PreCommitBatchWait},
{col: color.FgYellow, state: types.WaitSeed},
{col: color.FgYellow, state: types.Committing},
{col: color.FgYellow, state: types.CommitFinalize},
{col: color.FgYellow, state: types.SubmitCommit},
{col: color.FgYellow, state: types.CommitWait},
{col: color.FgYellow, state: types.SubmitCommitAggregate},
{col: color.FgYellow, state: types.CommitAggregateWait},
{col: color.FgYellow, state: types.FinalizeSector},

{col: color.FgCyan, state: types.Terminating},
Expand All @@ -110,11 +116,13 @@ var stateList = []stateMeta{
{col: color.FgCyan, state: types.Removed},

{col: color.FgRed, state: types.FailedUnrecoverable},
{col: color.FgRed, state: types.AddPieceFailed},
{col: color.FgRed, state: types.SealPreCommit1Failed},
{col: color.FgRed, state: types.SealPreCommit2Failed},
{col: color.FgRed, state: types.PreCommitFailed},
{col: color.FgRed, state: types.ComputeProofFailed},
{col: color.FgRed, state: types.CommitFailed},
{col: color.FgRed, state: types.CommitFinalizeFailed},
{col: color.FgRed, state: types.PackingFailed},
{col: color.FgRed, state: types.FinalizeFailed},
{col: color.FgRed, state: types.Faulty},
Expand Down
4 changes: 2 additions & 2 deletions config/local_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (fsr *LocalStorage) SetConfig(c func(interface{})) error {
fsr.configLk.Lock()
defer fsr.configLk.Unlock()

cfg, err := MinerFromFile(fsr.configPath)
cfg, err := MinerFromFile(FsConfig(fsr.configPath))
if err != nil {
return err
}
Expand All @@ -117,7 +117,7 @@ func (fsr *LocalStorage) SetConfig(c func(interface{})) error {
}

// write buffer of TOML bytes to config file
err = ioutil.WriteFile(fsr.configPath, buf.Bytes(), 0644)
err = ioutil.WriteFile(FsConfig(fsr.configPath), buf.Bytes(), 0644)
if err != nil {
return err
}
Expand Down

0 comments on commit a1c05e3

Please sign in to comment.