post workers: Fix lint

This commit is contained in:
Łukasz Magiera 2022-01-18 12:11:59 +01:00
parent b38141601c
commit c79f2b9d38
5 changed files with 14 additions and 7 deletions

View File

@ -4,6 +4,7 @@ import (
"context"
"crypto/rand"
"fmt"
"golang.org/x/xerrors"
ffi "github.com/filecoin-project/filecoin-ffi"

View File

@ -197,7 +197,7 @@ loop:
continue
}
d := storiface.Decl{s, fileType}
d := storiface.Decl{SectorID: s, SectorFileType: fileType}
for _, sid := range i.sectors[d] {
if sid.storage == storageID {
@ -228,7 +228,7 @@ func (i *Index) StorageDropSector(ctx context.Context, storageID storiface.ID, s
continue
}
d := storiface.Decl{s, fileType}
d := storiface.Decl{SectorID: s, SectorFileType: fileType}
if len(i.sectors[d]) == 0 {
continue
@ -267,7 +267,7 @@ func (i *Index) StorageFindSector(ctx context.Context, s abi.SectorID, ft storif
continue
}
for _, id := range i.sectors[storiface.Decl{s, pathType}] {
for _, id := range i.sectors[storiface.Decl{SectorID: s, SectorFileType: pathType}] {
storageIDs[id.storage]++
isprimary[id.storage] = isprimary[id.storage] || id.primary
}

View File

@ -785,6 +785,9 @@ func (r *Remote) GenerateSingleVanillaProof(ctx context.Context, minerID abi.Act
}
if resp.StatusCode != 200 {
if resp.StatusCode == 404 {
continue
}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, xerrors.Errorf("resp.Body ReadAll: %w", err)

View File

@ -535,8 +535,9 @@ func (n *Ensemble) Start() *Ensemble {
// using real proofs, therefore need real sectors.
if !n.bootstrapped && !n.options.mockProofs {
psd := m.PresealDir
err := lr.SetStorage(func(sc *stores.StorageConfig) {
sc.StoragePaths = append(sc.StoragePaths, stores.LocalPath{Path: m.PresealDir})
sc.StoragePaths = append(sc.StoragePaths, stores.LocalPath{Path: psd})
})
require.NoError(n.t, err)
@ -561,6 +562,8 @@ func (n *Ensemble) Start() *Ensemble {
require.NoError(n.t, err2)
}
noLocal := m.options.minerNoLocalSealing
var mineBlock = make(chan lotusminer.MineReq)
opts := []node.Option{
node.StorageMiner(&m.StorageMiner, cfg.Subsystems),
@ -578,7 +581,7 @@ func (n *Ensemble) Start() *Ensemble {
node.Override(new(sectorstorage.SealerConfig), func() sectorstorage.SealerConfig {
scfg := config.DefaultStorageMiner()
if m.options.minerNoLocalSealing {
if noLocal {
scfg.Storage.AllowAddPiece = false
scfg.Storage.AllowPreCommit1 = false
scfg.Storage.AllowPreCommit2 = false

View File

@ -75,7 +75,7 @@ func TestWindowPostWorker(t *testing.T) {
t.Log("Running one proving period")
waitUntil := di.Open + di.WPoStChallengeWindow*2 + storage.SubmitConfidence
ts := client.WaitTillChain(ctx, kit.HeightAtLeast(waitUntil))
client.WaitTillChain(ctx, kit.HeightAtLeast(waitUntil))
t.Log("Waiting for post message")
bm.Stop()
@ -101,7 +101,7 @@ func TestWindowPostWorker(t *testing.T) {
waitUntil = di.Open + di.WPoStChallengeWindow*3
t.Logf("End for head.Height > %d", waitUntil)
ts = client.WaitTillChain(ctx, kit.HeightAtLeast(waitUntil))
ts := client.WaitTillChain(ctx, kit.HeightAtLeast(waitUntil))
t.Logf("Now head.Height = %d", ts.Height())
p, err := client.StateMinerPower(ctx, maddr, types.EmptyTSK)