consensus: test proposal heartbeat

This commit is contained in:
Ethan Buchman
2017-08-10 01:24:23 -04:00
parent 1ea43e513d
commit c5a657f540
6 changed files with 44 additions and 7 deletions
+1 -1
View File
@@ -277,7 +277,7 @@ func (mem *Mempool) resCbRecheck(req *abci.Request, res *abci.Response) {
// TxsAvailable returns a channel which fires once for every height,
// and only when transactions are available in the mempool.
// NOTE: the returned channel may be nil if EnableTxsAvailable was not called.
func (mem *Mempool) TxsAvailable() chan int {
func (mem *Mempool) TxsAvailable() <-chan int {
return mem.txsAvailable
}
+2 -2
View File
@@ -28,7 +28,7 @@ func newMempoolWithApp(t *testing.T, cc proxy.ClientCreator) *Mempool {
return mempool
}
func ensureNoFire(t *testing.T, ch chan int, timeoutMS int) {
func ensureNoFire(t *testing.T, ch <-chan int, timeoutMS int) {
timer := time.NewTimer(time.Duration(timeoutMS) * time.Millisecond)
select {
case <-ch:
@@ -37,7 +37,7 @@ func ensureNoFire(t *testing.T, ch chan int, timeoutMS int) {
}
}
func ensureFire(t *testing.T, ch chan int, timeoutMS int) {
func ensureFire(t *testing.T, ch <-chan int, timeoutMS int) {
timer := time.NewTimer(time.Duration(timeoutMS) * time.Millisecond)
select {
case <-ch: