address linting FIXMEs

This commit is contained in:
Ethan Buchman
2017-11-27 21:48:15 +00:00
parent c4caad7720
commit 55b81cc1a1
6 changed files with 29 additions and 55 deletions

View File

@ -389,17 +389,3 @@ func timeoutWaitGroup(t *testing.T, n int, f func(*sync.WaitGroup, int), css []*
panic("Timed out waiting for all validators to commit a block")
}
}
// XXX: WARNING: this function can halt the consensus as firing events is synchronous.
// Make sure to read off the channels, and in the case of subscribeToEventRespond, to write back on it
// NOTE: this blocks on receiving a response after the event is consumed
func subscribeToEventRespond(evsw types.EventSwitch, receiver, eventID string) chan interface{} {
// listen for event
ch := make(chan interface{})
types.AddListenerForEvent(evsw, receiver, eventID, func(data types.TMEventData) {
ch <- data
<-ch
})
return ch
}