Skip to content

Commit

Permalink
Meta - Drop unnecessary nolint comments (#477)
Browse files Browse the repository at this point in the history
* Remove nolint comment and export timeout variables

* Drop unnecessary nolint

* Add comment

* Fix lint issue
  • Loading branch information
MatheusFranco99 authored Aug 20, 2024
1 parent 9bf4379 commit 642d9d2
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 18 deletions.
2 changes: 0 additions & 2 deletions qbft/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,9 @@ func (i *Instance) Start(value []byte, height Height) {
// propose if this node is the proposer
if proposer(i.State, i.GetConfig(), FirstRound) == i.State.CommitteeMember.OperatorID {
proposal, err := CreateProposal(i.State, i.signer, i.StartValue, nil, nil)
// nolint
if err != nil {
fmt.Printf("%s\n", err.Error())
}
// nolint
if err := i.Broadcast(proposal); err != nil {
fmt.Printf("%s\n", err.Error())
}
Expand Down
11 changes: 7 additions & 4 deletions qbft/timeout.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
package qbft

import (
"github.com/pkg/errors"
"time"

"github.com/pkg/errors"
)

// At the moment, these variables are useful for the node implementation
// TODO: It's usage should be updated in the PR https://github.com/ssvlabs/ssv-spec/pull/352
var (
quickTimeoutThreshold = Round(8) //nolint
quickTimeout = 2 * time.Second //nolint
slowTimeout = 2 * time.Minute //nolint
QuickTimeoutThreshold = Round(8)
QuickTimeout = 2 * time.Second
SlowTimeout = 2 * time.Minute
// CutoffRound which round the instance should stop its timer and progress no further
CutoffRound = 12 // stop processing attestations after 8*2+120*3 = 6.2 min (~ 1 epoch)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import (
func ConsensusNotStarted() tests.SpecTest {
ks := testingutils.Testing4SharesSet()

// TODO: check error
// nolint
startRunner := func(r ssv.Runner, duty types.Duty) ssv.Runner {
r.GetBaseRunner().State = ssv.NewRunnerState(3, duty)
return r
Expand Down
2 changes: 0 additions & 2 deletions ssv/spectest/tests/runner/duties/newduty/finished.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import (
func Finished() tests.SpecTest {
ks := testingutils.Testing4SharesSet()

// TODO: check error
// nolint
finishRunner := func(r ssv.Runner, duty types.Duty, finishController bool) ssv.Runner {
r.GetBaseRunner().State = ssv.NewRunnerState(3, duty)

Expand Down
2 changes: 0 additions & 2 deletions ssv/spectest/tests/runner/duties/newduty/not_decided.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import (
func NotDecided() tests.SpecTest {
ks := testingutils.Testing4SharesSet()

// TODO: check error
// nolint
startRunner := func(r ssv.Runner, duty types.Duty) ssv.Runner {
r.GetBaseRunner().State = ssv.NewRunnerState(3, duty)
r.GetBaseRunner().State.RunningInstance = qbft.NewInstance(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import (
func PostFutureDecided() tests.SpecTest {
ks := testingutils.Testing4SharesSet()

// TODO: check error
// nolint
futureDecide := func(r ssv.Runner, duty types.Duty) ssv.Runner {
r.GetBaseRunner().State = ssv.NewRunnerState(3, duty)
r.GetBaseRunner().State.RunningInstance = qbft.NewInstance(
Expand Down
2 changes: 0 additions & 2 deletions ssv/spectest/tests/runner/preconsensus/post_decided.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import (
func PostDecided() tests.SpecTest {
ks := testingutils.Testing4SharesSet()

// TODO: check errors
// nolint
decideRunner := func(r ssv.Runner, duty *types.ValidatorDuty, decidedValue *types.ValidatorConsensusData, preMsgs []*types.PartialSignatureMessages) ssv.Runner {
r.GetBaseRunner().State = ssv.NewRunnerState(3, duty)
for _, msg := range preMsgs {
Expand Down
2 changes: 0 additions & 2 deletions ssv/spectest/tests/runner/preconsensus/post_finish.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import (
func PostFinish() tests.SpecTest {
ks := testingutils.Testing4SharesSet()

// TODO: check errors
// nolint
finishRunner := func(runner ssv.Runner, duty *types.ValidatorDuty) ssv.Runner {
runner.GetBaseRunner().State = ssv.NewRunnerState(3, duty)
runner.GetBaseRunner().State.Finished = true
Expand Down

0 comments on commit 642d9d2

Please sign in to comment.