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 869086e commit fb0a153
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 68 deletions.
1 change: 0 additions & 1 deletion tm2/pkg/amino/reflect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ func TestCodecMarshalAny(t *testing.T) {

// Like TestCodecRoundtripNonNilRegisteredTypeDef, but JSON.
func TestCodecJSONRoundtripNonNilRegisteredTypeDef(t *testing.T) {

cdc := amino.NewCodec()
cdc.RegisterTypeFrom(reflect.TypeOf(tests.ConcreteTypeDef{}), tests.Package)

Expand Down
4 changes: 0 additions & 4 deletions tm2/pkg/bft/consensus/mempool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ func assertMempool(txn txNotifier) mempl.Mempool {
}

func TestMempoolNoProgressUntilTxsAvailable(t *testing.T) {

config, _ := ResetConfig("consensus_mempool_no_progress_until_txs_available")
defer os.RemoveAll(config.RootDir)
config.Consensus.CreateEmptyBlocks = false
Expand Down Expand Up @@ -72,7 +71,6 @@ func TestMempoolProgressAfterCreateEmptyBlocksInterval(t *testing.T) {
}

func TestMempoolProgressInHigherRound(t *testing.T) {

config, _ := ResetConfig("consensus_mempool_progress_in_higher_round")
defer os.RemoveAll(config.RootDir)
config.Consensus.CreateEmptyBlocks = false
Expand Down Expand Up @@ -140,7 +138,6 @@ func deliverTxsRange(cs *ConsensusState, start, end int) {
}

func TestMempoolTxConcurrentWithCommit(t *testing.T) {

state, privVals := randGenesisState(1, false, 10)
blockDB := memdb.NewMemDB()
app := NewCounterApplication()
Expand Down Expand Up @@ -172,7 +169,6 @@ func TestMempoolTxConcurrentWithCommit(t *testing.T) {
}

func TestMempoolRmBadTx(t *testing.T) {

state, privVals := randGenesisState(1, false, 10)
app := NewCounterApplication()
blockDB := memdb.NewMemDB()
Expand Down
14 changes: 0 additions & 14 deletions tm2/pkg/bft/consensus/reactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ func TestReactorBasic(t *testing.T) {

// Ensure a testnet makes blocks when there are txs
func TestReactorCreatesBlockWhenEmptyBlocksFalse(t *testing.T) {

N := 4
css, cleanup := randConsensusNet(N, "consensus_reactor_test", newMockTickerFunc(true), newCounter,
func(c *cfg.Config) {
Expand All @@ -124,7 +123,6 @@ func TestReactorCreatesBlockWhenEmptyBlocksFalse(t *testing.T) {
}

func TestReactorReceiveDoesNotPanicIfAddPeerHasntBeenCalledYet(t *testing.T) {

N := 1
css, cleanup := randConsensusNet(N, "consensus_reactor_test", newMockTickerFunc(true), newCounter)
defer cleanup()
Expand All @@ -147,7 +145,6 @@ func TestReactorReceiveDoesNotPanicIfAddPeerHasntBeenCalledYet(t *testing.T) {
}

func TestReactorReceivePanicsIfInitPeerHasntBeenCalledYet(t *testing.T) {

N := 1
css, cleanup := randConsensusNet(N, "consensus_reactor_test", newMockTickerFunc(true), newCounter)
defer cleanup()
Expand All @@ -170,7 +167,6 @@ func TestReactorReceivePanicsIfInitPeerHasntBeenCalledYet(t *testing.T) {

// Test we record stats about votes and block parts from other peers.
func TestFlappyReactorRecordsVotesAndBlockParts(t *testing.T) {

testutils.FilterStability(t, testutils.Flappy)

N := 4
Expand All @@ -197,7 +193,6 @@ func TestFlappyReactorRecordsVotesAndBlockParts(t *testing.T) {
// ensure we can make blocks despite cycling a validator set

func TestReactorVotingPowerChange(t *testing.T) {

nVals := 4
logger := log.NewTestingLogger(t)
css, cleanup := randConsensusNet(nVals, "consensus_voting_power_changes_test", newMockTickerFunc(true), newPersistentKVStore)
Expand Down Expand Up @@ -260,7 +255,6 @@ func TestReactorVotingPowerChange(t *testing.T) {
}

func TestReactorValidatorSetChanges(t *testing.T) {

nPeers := 7
nVals := 4
css, _, _, cleanup := randConsensusNetWithPeers(nVals, nPeers, "consensus_val_set_changes_test", newMockTickerFunc(true), newPersistentKVStoreWithPath)
Expand Down Expand Up @@ -357,7 +351,6 @@ func TestReactorValidatorSetChanges(t *testing.T) {

// Check we can make blocks with skip_timeout_commit=false
func TestReactorWithTimeoutCommit(t *testing.T) {

N := 4
css, cleanup := randConsensusNet(N, "consensus_reactor_with_timeout_commit_test", newMockTickerFunc(false), newCounter)
defer cleanup()
Expand Down Expand Up @@ -518,7 +511,6 @@ func timeoutWaitGroup(t *testing.T, n int, f func(int), css []*ConsensusState) {
// Ensure basic validation of structs is functioning

func TestNewRoundStepMessageValidateBasic(t *testing.T) {

testCases := []struct {
testName string
messageHeight int64
Expand Down Expand Up @@ -552,7 +544,6 @@ func TestNewRoundStepMessageValidateBasic(t *testing.T) {
}

func TestNewValidBlockMessageValidateBasic(t *testing.T) {

testCases := []struct {
malleateFn func(*NewValidBlockMessage)
expErr string
Expand Down Expand Up @@ -600,7 +591,6 @@ func TestNewValidBlockMessageValidateBasic(t *testing.T) {
}

func TestProposalPOLMessageValidateBasic(t *testing.T) {

testCases := []struct {
malleateFn func(*ProposalPOLMessage)
expErr string
Expand Down Expand Up @@ -635,7 +625,6 @@ func TestProposalPOLMessageValidateBasic(t *testing.T) {
}

func TestBlockPartMessageValidateBasic(t *testing.T) {

testPart := new(types.Part)
testPart.Proof.LeafHash = tmhash.Sum([]byte("leaf"))
testCases := []struct {
Expand Down Expand Up @@ -671,7 +660,6 @@ func TestBlockPartMessageValidateBasic(t *testing.T) {
}

func TestHasVoteMessageValidateBasic(t *testing.T) {

const (
validSignedMsgType types.SignedMsgType = 0x01
invalidSignedMsgType types.SignedMsgType = 0x03
Expand Down Expand Up @@ -709,7 +697,6 @@ func TestHasVoteMessageValidateBasic(t *testing.T) {
}

func TestVoteSetMaj23MessageValidateBasic(t *testing.T) {

const (
validSignedMsgType types.SignedMsgType = 0x01
invalidSignedMsgType types.SignedMsgType = 0x03
Expand Down Expand Up @@ -756,7 +743,6 @@ func TestVoteSetMaj23MessageValidateBasic(t *testing.T) {
}

func TestVoteSetBitsMessageValidateBasic(t *testing.T) {

testCases := []struct { //nolint: maligned
malleateFn func(*VoteSetBitsMessage)
expErr string
Expand Down
11 changes: 0 additions & 11 deletions tm2/pkg/bft/consensus/replay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ func sendTxs(ctx context.Context, cs *ConsensusState) {

// TestWALCrash uses crashing WAL to test we can recover from any WAL failure.
func TestWALCrash(t *testing.T) {

testCases := []struct {
name string
initFn func(dbm.DB, *ConsensusState, context.Context)
Expand Down Expand Up @@ -338,7 +337,6 @@ var modes = []uint{0, 1, 2}
// Caller should call `defer sim.CleanupFunc()`
func makeTestSim(t *testing.T, name string) (sim testSim) {
t.Helper()

nPeers := 7
nVals := 4
css, genDoc, config, cleanup := randConsensusNetWithPeers(nVals, nPeers, "replay_test_"+name, newMockTickerFunc(true), newPersistentKVStoreWithPath)
Expand Down Expand Up @@ -525,7 +523,6 @@ func makeTestSim(t *testing.T, name string) (sim testSim) {

// Sync from scratch
func TestHandshakeReplayAll(t *testing.T) {

for _, m := range modes {
testHandshakeReplay(t, config, 0, m, nil)
}
Expand All @@ -538,7 +535,6 @@ func TestHandshakeReplayAll(t *testing.T) {

// Sync many, not from scratch
func TestHandshakeReplaySome(t *testing.T) {

for _, m := range modes {
testHandshakeReplay(t, config, 1, m, nil)
}
Expand All @@ -551,7 +547,6 @@ func TestHandshakeReplaySome(t *testing.T) {

// Sync from lagging by one
func TestHandshakeReplayOne(t *testing.T) {

for _, m := range modes {
testHandshakeReplay(t, config, numBlocks-1, m, nil)
}
Expand All @@ -564,7 +559,6 @@ func TestHandshakeReplayOne(t *testing.T) {

// Sync from caught up
func TestFlappyHandshakeReplayNone(t *testing.T) {

testutils.FilterStability(t, testutils.Flappy)

for _, m := range modes {
Expand All @@ -579,7 +573,6 @@ func TestFlappyHandshakeReplayNone(t *testing.T) {

// Test mockProxyApp should not panic when app return ABCIResponses with some empty ResponseDeliverTx
func TestMockProxyApp(t *testing.T) {

logger := log.NewTestingLogger(t)
validTxs, invalidTxs := 0, 0
txIndex := 0
Expand Down Expand Up @@ -644,7 +637,6 @@ func tempWALWithData(data []byte) string {
// Make some blocks. Start a fresh app and apply nBlocks blocks. Then restart the app and sync it up with the remaining blocks
func testHandshakeReplay(t *testing.T, config *cfg.Config, nBlocks int, mode uint, sim *testSim) {
t.Helper()

var (
chain []*types.Block
commits []*types.Commit
Expand Down Expand Up @@ -839,7 +831,6 @@ func buildTMStateFromChain(config *cfg.Config, stateDB dbm.DB, state sm.State, c
}

func TestHandshakePanicsIfAppReturnsWrongAppHash(t *testing.T) {

// 1. Initialize tendermint and commit 3 blocks with the following app hashes:
// - 0x01
// - 0x02
Expand Down Expand Up @@ -1119,7 +1110,6 @@ func (bs *mockBlockStore) LoadSeenCommit(height int64) *types.Commit {
// Test handshake/init chain

func TestHandshakeUpdatesValidators(t *testing.T) {

val, _ := types.RandValidator(true, 10)
vals := types.NewValidatorSet([]*types.Validator{val})
appVals := vals.ABCIValidatorUpdates()
Expand Down Expand Up @@ -1157,7 +1147,6 @@ func TestHandshakeUpdatesValidators(t *testing.T) {
}

func TestHandshakeGenesisResponseDeliverTx(t *testing.T) {

const numInitResponses = 42

app := initChainApp{
Expand Down
1 change: 0 additions & 1 deletion tm2/pkg/bft/consensus/wal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ func makeTempWAL(t *testing.T, walChunkSize int64) (wal walm.WAL) {
// ----------------------------------------

func TestWALTruncate(t *testing.T) {

const walChunkSize = 409610 // 4KB
wal := makeTempWAL(t, walChunkSize)

Expand Down
1 change: 0 additions & 1 deletion tm2/pkg/bft/rpc/core/net_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ func TestUnsafeDialSeeds(t *testing.T) {
}

func TestUnsafeDialPeers(t *testing.T) {

sw := p2p.MakeSwitch(p2pcfg.DefaultP2PConfig(), 1, "testing", "123.123.123",
func(n int, sw *p2p.Switch) *p2p.Switch { return sw })
err := sw.Start()
Expand Down
6 changes: 0 additions & 6 deletions tm2/pkg/bft/state/execution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ var (
)

func TestApplyBlock(t *testing.T) {

cc := proxy.NewLocalClientCreator(kvstore.NewKVStoreApplication())
proxyApp := appconn.NewAppConns(cc)
err := proxyApp.Start()
Expand All @@ -55,7 +54,6 @@ func TestApplyBlock(t *testing.T) {

// TestBeginBlockValidators ensures we send absent validators list.
func TestBeginBlockValidators(t *testing.T) {

app := &testApp{}
cc := proxy.NewLocalClientCreator(app)
proxyApp := appconn.NewAppConns(cc)
Expand Down Expand Up @@ -107,7 +105,6 @@ func TestBeginBlockValidators(t *testing.T) {
}

func TestValidateValidatorUpdates(t *testing.T) {

pubkey1 := ed25519.GenPrivKey().PubKey()
pubkey2 := ed25519.GenPrivKey().PubKey()

Expand Down Expand Up @@ -180,7 +177,6 @@ func TestValidateValidatorUpdates(t *testing.T) {
}

func TestUpdateValidators(t *testing.T) {

pubkey1 := ed25519.GenPrivKey().PubKey()
val1 := types.NewValidator(pubkey1, 10)
pubkey2 := ed25519.GenPrivKey().PubKey()
Expand Down Expand Up @@ -257,7 +253,6 @@ func TestUpdateValidators(t *testing.T) {

// TestEndBlockValidatorUpdates ensures we update validator set and send an event.
func TestEndBlockValidatorUpdates(t *testing.T) {

app := &testApp{}
cc := proxy.NewLocalClientCreator(app)
proxyApp := appconn.NewAppConns(cc)
Expand Down Expand Up @@ -324,7 +319,6 @@ LOOP:
// TestEndBlockValidatorUpdatesResultingInEmptySet checks that processing validator updates that
// would result in empty set causes no panic, an error is raised and NextValidators is not updated
func TestEndBlockValidatorUpdatesResultingInEmptySet(t *testing.T) {

app := &testApp{}
cc := proxy.NewLocalClientCreator(app)
proxyApp := appconn.NewAppConns(cc)
Expand Down
Loading

0 comments on commit fb0a153

Please sign in to comment.