From 77208728ad545c25cdad7364a5c39fbb52dd1b33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 9 Aug 2022 13:43:08 +0200 Subject: [PATCH] sealing: fix lint/tests --- node/modules/storageminer.go | 2 +- storage/pipeline/precommit_policy_test.go | 3 ++- storage/pipeline/sealing.go | 8 ++------ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/node/modules/storageminer.go b/node/modules/storageminer.go index c28342504..7a6d48784 100644 --- a/node/modules/storageminer.go +++ b/node/modules/storageminer.go @@ -222,7 +222,7 @@ func PreflightChecks(mctx helpers.MetricsCtx, lc fx.Lifecycle, api v1api.FullNod } if !has { - return errors.New("key for worker not found in local wallet") + return xerrors.New("key for worker not found in local wallet") } log.Infof("starting up miner %s, worker addr %s", maddr, workerKey) diff --git a/storage/pipeline/precommit_policy_test.go b/storage/pipeline/precommit_policy_test.go index d673126b9..5d2da1ee0 100644 --- a/storage/pipeline/precommit_policy_test.go +++ b/storage/pipeline/precommit_policy_test.go @@ -18,6 +18,7 @@ import ( "github.com/filecoin-project/lotus/chain/actors/builtin" "github.com/filecoin-project/lotus/chain/actors/policy" "github.com/filecoin-project/lotus/chain/types" + "github.com/filecoin-project/lotus/node/modules/dtypes" pipeline "github.com/filecoin-project/lotus/storage/pipeline" "github.com/filecoin-project/lotus/storage/pipeline/sealiface" ) @@ -30,7 +31,7 @@ type fakeConfigStub struct { CCSectorLifetime time.Duration } -func fakeConfigGetter(stub *fakeConfigStub) pipeline.GetSealingConfigFunc { +func fakeConfigGetter(stub *fakeConfigStub) dtypes.GetSealingConfigFunc { return func() (sealiface.Config, error) { if stub == nil { return sealiface.Config{}, nil diff --git a/storage/pipeline/sealing.go b/storage/pipeline/sealing.go index c261c0468..6bc5f508d 100644 --- a/storage/pipeline/sealing.go +++ b/storage/pipeline/sealing.go @@ -218,14 +218,10 @@ func New(mctx context.Context, api SealingAPI, fc config.MinerFeeConfig, events return s } -func (m *Sealing) Run(ctx context.Context) error { - +func (m *Sealing) Run(ctx context.Context) { if err := m.restartSectors(ctx); err != nil { - log.Errorf("%+v", err) - return xerrors.Errorf("failed load sector states: %w", err) + log.Errorf("failed load sector states: %+v", err) } - - return nil } func (m *Sealing) Stop(ctx context.Context) error {