Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
DIGIX666 committed Sep 22, 2024
1 parent fb0a153 commit f59e76f
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 34 deletions.
7 changes: 0 additions & 7 deletions tm2/pkg/bft/consensus/reactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,6 @@ func TestNewRoundStepMessageValidateBasic(t *testing.T) {
for _, tc := range testCases {
tc := tc
t.Run(tc.testName, func(t *testing.T) {

message := NewRoundStepMessage{
Height: tc.messageHeight,
Round: tc.messageRound,
Expand Down Expand Up @@ -571,7 +570,6 @@ func TestNewValidBlockMessageValidateBasic(t *testing.T) {
for i, tc := range testCases {
tc := tc
t.Run(fmt.Sprintf("#%d", i), func(t *testing.T) {

msg := &NewValidBlockMessage{
Height: 1,
Round: 0,
Expand Down Expand Up @@ -608,7 +606,6 @@ func TestProposalPOLMessageValidateBasic(t *testing.T) {
for i, tc := range testCases {
tc := tc
t.Run(fmt.Sprintf("#%d", i), func(t *testing.T) {

msg := &ProposalPOLMessage{
Height: 1,
ProposalPOLRound: 1,
Expand Down Expand Up @@ -642,7 +639,6 @@ func TestBlockPartMessageValidateBasic(t *testing.T) {
for _, tc := range testCases {
tc := tc
t.Run(tc.testName, func(t *testing.T) {

message := BlockPartMessage{
Height: tc.messageHeight,
Round: tc.messageRound,
Expand Down Expand Up @@ -683,7 +679,6 @@ func TestHasVoteMessageValidateBasic(t *testing.T) {
for _, tc := range testCases {
tc := tc
t.Run(tc.testName, func(t *testing.T) {

message := HasVoteMessage{
Height: tc.messageHeight,
Round: tc.messageRound,
Expand Down Expand Up @@ -729,7 +724,6 @@ func TestVoteSetMaj23MessageValidateBasic(t *testing.T) {
for _, tc := range testCases {
tc := tc
t.Run(tc.testName, func(t *testing.T) {

message := VoteSetMaj23Message{
Height: tc.messageHeight,
Round: tc.messageRound,
Expand Down Expand Up @@ -769,7 +763,6 @@ func TestVoteSetBitsMessageValidateBasic(t *testing.T) {
for i, tc := range testCases {
tc := tc
t.Run(fmt.Sprintf("#%d", i), func(t *testing.T) {

msg := &VoteSetBitsMessage{
Height: 1,
Round: 0,
Expand Down
1 change: 0 additions & 1 deletion tm2/pkg/bft/consensus/replay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ func TestWALCrash(t *testing.T) {
tc := tc
consensusReplayConfig, genesisFile := ResetConfig(fmt.Sprintf("%s_%d", t.Name(), i))
t.Run(tc.name, func(t *testing.T) {

crashWALandCheckLiveness(
t,
consensusReplayConfig,
Expand Down
24 changes: 0 additions & 24 deletions tm2/pkg/bft/consensus/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ x * TestHalt1 - if we see +2/3 precommits after timing out into new round, we sh
// ProposeSuite

func TestStateProposerSelection0(t *testing.T) {

cs1, vss := randConsensusState(4)
height, round := cs1.Height, cs1.Round

Expand Down Expand Up @@ -106,7 +105,6 @@ func TestStateProposerSelection0(t *testing.T) {

// Now let's do it all again, but starting from round 2 instead of 0
func TestStateProposerSelection2(t *testing.T) {

cs1, vss := randConsensusState(4) // test needs more work for more than 3 validators
height := cs1.Height
newRoundCh := subscribe(cs1.evsw, cstypes.EventNewRound{})
Expand Down Expand Up @@ -143,7 +141,6 @@ func TestStateProposerSelection2(t *testing.T) {

// a non-validator should timeout into the prevote round
func TestStateEnterProposeNoPrivValidator(t *testing.T) {

cs, _ := randConsensusState(1)
cs.SetPrivValidator(nil)
height, round := cs.Height, cs.Round
Expand All @@ -167,7 +164,6 @@ func TestStateEnterProposeNoPrivValidator(t *testing.T) {

// a validator should not timeout of the prevote round (TODO: unless the block is really big!)
func TestStateEnterProposeYesPrivValidator(t *testing.T) {

cs, _ := randConsensusState(1)
height, round := cs.Height, cs.Round

Expand Down Expand Up @@ -206,7 +202,6 @@ func TestStateEnterProposeYesPrivValidator(t *testing.T) {

func TestStateBadProposal(t *testing.T) {
var mu sync.Mutex

cs1, vss := randConsensusState(2)
height, round := cs1.Height, cs1.Round
vs2 := vss[1]
Expand Down Expand Up @@ -315,7 +310,6 @@ func TestStateFullRound1(t *testing.T) {

// nil is proposed, so prevote and precommit nil
func TestStateFullRoundNil(t *testing.T) {

cs, vss := randConsensusState(1)
height, round := cs.Height, cs.Round
cs.decideProposal = func(height int64, round int) {
Expand All @@ -341,7 +335,6 @@ func TestStateFullRoundNil(t *testing.T) {
// run through propose, prevote, precommit commit with two validators
// where the first validator has to wait for votes from the second
func TestStateFullRound2(t *testing.T) {

cs1, vss := randConsensusState(2)
vs2 := vss[1]
height, round := cs1.Height, cs1.Round
Expand Down Expand Up @@ -387,7 +380,6 @@ func TestStateFullRound2(t *testing.T) {
// two validators, 4 rounds.
// two vals take turns proposing. val1 locks on first one, precommits nil on everything else
func TestStateLockNoPOL(t *testing.T) {

cs1, vss := randConsensusState(2)
vs2 := vss[1]
height, round := cs1.Height, cs1.Round
Expand Down Expand Up @@ -559,7 +551,6 @@ func TestStateLockNoPOL(t *testing.T) {

// 4 vals, one precommits, other 3 polka at next round, so we unlock and precomit the polka
func TestStateLockPOLRelock(t *testing.T) {

cs1, vss := randConsensusState(4)
vs2, vs3, vs4 := vss[1], vss[2], vss[3]
height, round := cs1.Height, cs1.Round
Expand Down Expand Up @@ -657,7 +648,6 @@ func TestStateLockPOLRelock(t *testing.T) {

// 4 vals, one precommits, other 3 polka at next round, so we unlock and precomit the polka
func TestStateLockPOLUnlock(t *testing.T) {

cs1, vss := randConsensusState(4)
vs2, vs3, vs4 := vss[1], vss[2], vss[3]
height, round := cs1.Height, cs1.Round
Expand Down Expand Up @@ -759,7 +749,6 @@ func TestStateLockPOLUnlock(t *testing.T) {
// then a polka at round 2 that we lock on
// then we see the polka from round 1 but shouldn't unlock
func TestStateLockPOLSafety1(t *testing.T) {

cs1, vss := randConsensusState(4)
vs2, vs3, vs4 := vss[1], vss[2], vss[3]
height, round := cs1.Height, cs1.Round
Expand Down Expand Up @@ -881,7 +870,6 @@ func TestStateLockPOLSafety1(t *testing.T) {
// What we want:
// dont see P0, lock on P1 at R1, dont unlock using P0 at R2
func TestStateLockPOLSafety2(t *testing.T) {

cs1, vss := randConsensusState(4)
vs2, vs3, vs4 := vss[1], vss[2], vss[3]
height, round := cs1.Height, cs1.Round
Expand Down Expand Up @@ -978,7 +966,6 @@ func TestStateLockPOLSafety2(t *testing.T) {
// What we want:
// P0 proposes B0 at R3.
func TestProposeValidBlock(t *testing.T) {

cs1, vss := randConsensusState(4)
vs2, vs3, vs4 := vss[1], vss[2], vss[3]
height, round := cs1.Height, cs1.Round
Expand Down Expand Up @@ -1153,7 +1140,6 @@ func TestSetValidBlockOnDelayedPrevote(t *testing.T) {
// P0 miss to lock B as Proposal Block is missing, but set valid block to B after
// receiving delayed Block Proposal.
func TestSetValidBlockOnDelayedProposal(t *testing.T) {

cs1, vss := randConsensusState(4)
vs2, vs3, vs4 := vss[1], vss[2], vss[3]
height, round := cs1.Height, cs1.Round
Expand Down Expand Up @@ -1213,7 +1199,6 @@ func TestSetValidBlockOnDelayedProposal(t *testing.T) {
// What we want:
// P0 waits for timeoutPrecommit before starting next round
func TestWaitingTimeoutOnNilPolka(t *testing.T) {

cs1, vss := randConsensusState(4)
vs2, vs3, vs4 := vss[1], vss[2], vss[3]
height, round := cs1.Height, cs1.Round
Expand All @@ -1240,7 +1225,6 @@ func TestWaitingTimeoutOnNilPolka(t *testing.T) {
// What we want:
// P0 waits for timeoutPropose in the next round before entering prevote
func TestWaitingTimeoutProposeOnNewRound(t *testing.T) {

cs1, vss := randConsensusState(4)
vs2, vs3, vs4 := vss[1], vss[2], vss[3]
height, round := cs1.Height, cs1.Round
Expand Down Expand Up @@ -1280,7 +1264,6 @@ func TestWaitingTimeoutProposeOnNewRound(t *testing.T) {
// What we want:
// P0 jump to higher round, precommit and start precommit wait
func TestRoundSkipOnNilPolkaFromHigherRound(t *testing.T) {

cs1, vss := randConsensusState(4)
vs2, vs3, vs4 := vss[1], vss[2], vss[3]
height, round := cs1.Height, cs1.Round
Expand Down Expand Up @@ -1320,7 +1303,6 @@ func TestRoundSkipOnNilPolkaFromHigherRound(t *testing.T) {
// What we want:
// P0 wait for timeoutPropose to expire before sending prevote.
func TestWaitTimeoutProposeOnNilPolkaForTheCurrentRound(t *testing.T) {

cs1, vss := randConsensusState(4)
vs2, vs3, vs4 := vss[1], vss[2], vss[3]
height, round := cs1.Height, 1
Expand Down Expand Up @@ -1352,7 +1334,6 @@ func TestWaitTimeoutProposeOnNilPolkaForTheCurrentRound(t *testing.T) {
// P0 emit NewValidBlock event upon receiving 2/3+ Precommit for B but hasn't received block B yet
func TestEmitNewValidBlockEventOnCommitWithoutBlock(t *testing.T) {
var mu sync.Mutex

cs1, vss := randConsensusState(4)
vs2, vs3, vs4 := vss[1], vss[2], vss[3]
height, round := cs1.Height, 1
Expand Down Expand Up @@ -1394,7 +1375,6 @@ func TestEmitNewValidBlockEventOnCommitWithoutBlock(t *testing.T) {
// After receiving block, it executes block and moves to the next height.
func TestCommitFromPreviousRound(t *testing.T) {
var mu sync.Mutex

cs1, vss := randConsensusState(4)
vs2, vs3, vs4 := vss[1], vss[2], vss[3]
height, round := cs1.Height, 1
Expand Down Expand Up @@ -1527,7 +1507,6 @@ func TestStartNextHeightCorrectly(t *testing.T) {
}

func TestFlappyResetTimeoutPrecommitUponNewHeight(t *testing.T) {

testutils.FilterStability(t, testutils.Flappy)

config.Consensus.SkipTimeoutCommit = false
Expand Down Expand Up @@ -1676,7 +1655,6 @@ func TestStateSlashingPrecommits(t *testing.T) {
// 4 vals.
// we receive a final precommit after going into next round, but others might have gone to commit already!
func TestFlappyStateHalt1(t *testing.T) {

testutils.FilterStability(t, testutils.Flappy)
cs1, vss := randConsensusState(4)
vs2, vs3, vs4 := vss[1], vss[2], vss[3]
Expand Down Expand Up @@ -1749,7 +1727,6 @@ func TestFlappyStateHalt1(t *testing.T) {

func TestStateOutputsBlockPartsStats(t *testing.T) {
var mu sync.Mutex

// create dummy peer
cs, _ := randConsensusState(1)
peer := p2pmock.NewPeer(nil)
Expand Down Expand Up @@ -1802,7 +1779,6 @@ func TestStateOutputsBlockPartsStats(t *testing.T) {
}

func TestStateOutputVoteStats(t *testing.T) {

cs, vss := randConsensusState(2)
// create dummy peer
peer := p2pmock.NewPeer(nil)
Expand Down
2 changes: 0 additions & 2 deletions tm2/pkg/bft/state/execution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ func TestValidateValidatorUpdates(t *testing.T) {
for _, tc := range testCases {
tc := tc
t.Run(tc.name, func(t *testing.T) {

err := sm.ValidateValidatorUpdates(tc.abciUpdates, tc.validatorParams)
if tc.shouldErr {
assert.Error(t, err)
Expand Down Expand Up @@ -232,7 +231,6 @@ func TestUpdateValidators(t *testing.T) {
for _, tc := range testCases {
tc := tc
t.Run(tc.name, func(t *testing.T) {

err := tc.currentSet.UpdateWithABCIValidatorUpdates(tc.abciUpdates)
if tc.shouldErr {
assert.Error(t, err)
Expand Down

0 comments on commit f59e76f

Please sign in to comment.