sealing: fix lint issues

This commit is contained in:
Łukasz Magiera 2022-03-16 20:28:15 +01:00
parent 2961f3b864
commit 3b2a1ea41d
3 changed files with 10 additions and 9 deletions

View File

@ -575,8 +575,8 @@ func (m *Sealing) tryGetUpgradeSector(ctx context.Context, sp abi.RegisteredSeal
continue
}
slowChecks := func() bool {
active, err := m.sectorActive(ctx, TipSetToken{}, s.Number)
slowChecks := func(sid abi.SectorNumber) bool {
active, err := m.sectorActive(ctx, TipSetToken{}, sid)
if err != nil {
log.Errorw("checking sector active", "error", err)
return false
@ -592,7 +592,7 @@ func (m *Sealing) tryGetUpgradeSector(ctx context.Context, sp abi.RegisteredSeal
// if best is above target, we want lower pledge, but only if still above target
if bestExpiration < targetExpiration {
if expiration > bestExpiration && slowChecks() {
if expiration > bestExpiration && slowChecks(s.Number) {
bestExpiration = expiration
bestPledge = pledge
candidate = s
@ -600,7 +600,7 @@ func (m *Sealing) tryGetUpgradeSector(ctx context.Context, sp abi.RegisteredSeal
continue
}
if expiration >= targetExpiration && pledge.LessThan(bestPledge) && slowChecks() {
if expiration >= targetExpiration && pledge.LessThan(bestPledge) && slowChecks(s.Number) {
bestExpiration = expiration
bestPledge = pledge
candidate = s

View File

@ -2,11 +2,11 @@ package sealing
import (
"context"
market7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/market"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-state-types/abi"
market7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/market"
)
func (m *Sealing) MarkForSnapUpgrade(ctx context.Context, id abi.SectorNumber) error {

View File

@ -4,19 +4,20 @@ package itests
import (
"context"
"fmt"
"github.com/filecoin-project/lotus/api"
sealing "github.com/filecoin-project/lotus/extern/storage-sealing"
"testing"
"time"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/itests/kit"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/chain/types"
sealing "github.com/filecoin-project/lotus/extern/storage-sealing"
"github.com/filecoin-project/lotus/itests/kit"
)
func TestCCUpgrade(t *testing.T) {