From 5120add25ab083156ec1eb4b6f59e65b1b8c0d53 Mon Sep 17 00:00:00 2001 From: "Andrew Jackson (Ajax)" Date: Sat, 25 Nov 2023 09:15:09 -0600 Subject: [PATCH] fix: lints --- cmd/lotus-provider/proving.go | 5 ++++- provider/builder.go | 4 +--- provider/lpmessage/sender.go | 5 ++++- storage/sealer/fr32/fr32_test.go | 3 ++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/cmd/lotus-provider/proving.go b/cmd/lotus-provider/proving.go index 3d432b608..db34050b5 100644 --- a/cmd/lotus-provider/proving.go +++ b/cmd/lotus-provider/proving.go @@ -107,7 +107,10 @@ var wdPostTaskCmd = &cli.Command{ var result string for { time.Sleep(time.Second) - deps.db.QueryRow(ctx, `SELECT result FROM harmony_test WHERE task_id=$1`, id).Scan(&result) + err = deps.db.QueryRow(ctx, `SELECT result FROM harmony_test WHERE task_id=$1`, id).Scan(&result) + if err != nil { + return xerrors.Errorf("reading result from harmony_test: %w", err) + } if result != "" { break } diff --git a/provider/builder.go b/provider/builder.go index 928eaaac7..e6adc1795 100644 --- a/provider/builder.go +++ b/provider/builder.go @@ -4,8 +4,6 @@ import ( "context" "time" - logging "github.com/ipfs/go-log/v2" - "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/lib/harmony/harmonydb" "github.com/filecoin-project/lotus/node/config" @@ -19,7 +17,7 @@ import ( "github.com/filecoin-project/lotus/storage/sealer/storiface" ) -var log = logging.Logger("provider") +//var log = logging.Logger("provider") func WindowPostScheduler(ctx context.Context, fc config.LotusProviderFees, pc config.ProvingConfig, api api.FullNode, verif storiface.Verifier, lw *sealer.LocalWorker, diff --git a/provider/lpmessage/sender.go b/provider/lpmessage/sender.go index 40e32039a..310d4aa82 100644 --- a/provider/lpmessage/sender.go +++ b/provider/lpmessage/sender.go @@ -164,7 +164,10 @@ func (s *Sender) Send(ctx context.Context, msg *types.Message, mss *api.MessageS return false, xerrors.Errorf("marshaling message: %w", err) } id := ctx.Value(CtxTestTaskID) - tx.Exec(`UPDATE harmony_test SET result=$1 WHERE task_id=$2`, string(data), id) + _, err = tx.Exec(`UPDATE harmony_test SET result=$1 WHERE task_id=$2`, string(data), id) + if err != nil { + return false, xerrors.Errorf("updating harmony_test: %w", err) + } log.Infof("SKIPPED sending test message to chain. Query harmony_test WHERE task_id= %v", id) return true, nil // nothing committed } diff --git a/storage/sealer/fr32/fr32_test.go b/storage/sealer/fr32/fr32_test.go index 437fa4e43..feb608327 100644 --- a/storage/sealer/fr32/fr32_test.go +++ b/storage/sealer/fr32/fr32_test.go @@ -2,8 +2,8 @@ package fr32_test import ( "bytes" + "crypto/rand" "io" - "math/rand" "os" "testing" @@ -70,6 +70,7 @@ func TestPadChunkFFI(t *testing.T) { } func TestPadChunkRandEqFFI(t *testing.T) { + for i := 0; i < 200; i++ { var input [127]byte rand.Read(input[:])