------------------------------------ Ensure a testnet makes blocks when there are txs
(t *testing.T)
| 236 | |
| 237 | // Ensure a testnet makes blocks when there are txs |
| 238 | func TestReactorCreatesBlockWhenEmptyBlocksFalse(t *testing.T) { |
| 239 | N := 4 |
| 240 | css, cleanup := randConsensusNet(N, "consensus_reactor_test", newMockTickerFunc(true), newCounter, |
| 241 | func(c *cfg.Config) { |
| 242 | c.Consensus.CreateEmptyBlocks = false |
| 243 | }) |
| 244 | defer cleanup() |
| 245 | reactors, blocksSubs, eventBuses := startConsensusNet(t, css, N) |
| 246 | defer stopConsensusNet(log.TestingLogger(), reactors, eventBuses) |
| 247 | |
| 248 | // send a tx |
| 249 | if err := assertMempool(css[3].txNotifier).CheckTx([]byte{1, 2, 3}, nil, mempl.TxInfo{}); err != nil { |
| 250 | t.Error(err) |
| 251 | } |
| 252 | |
| 253 | // wait till everyone makes the first new block |
| 254 | timeoutWaitGroup(t, N, func(j int) { |
| 255 | <-blocksSubs[j].Out() |
| 256 | }, css) |
| 257 | } |
| 258 | |
| 259 | func TestLegacyReactorReceiveBasicIfAddPeerHasntBeenCalledYet(t *testing.T) { |
| 260 | N := 1 |
nothing calls this directly
no test coverage detected