|
|
@ -331,7 +331,7 @@ func TestStateFullRound1(t *testing.T) { |
|
|
|
t.Error(err) |
|
|
|
} |
|
|
|
|
|
|
|
voteCh := subscribeUnBuffered(cs.eventBus, types.EventQueryVote) |
|
|
|
voteCh := subscribe(cs.eventBus, types.EventQueryVote) |
|
|
|
propCh := subscribe(cs.eventBus, types.EventQueryCompleteProposal) |
|
|
|
newRoundCh := subscribe(cs.eventBus, types.EventQueryNewRound) |
|
|
|
|
|
|
@ -361,7 +361,7 @@ func TestStateFullRoundNil(t *testing.T) { |
|
|
|
cs, vss := randState(config, 1) |
|
|
|
height, round := cs.Height, cs.Round |
|
|
|
|
|
|
|
voteCh := subscribeUnBuffered(cs.eventBus, types.EventQueryVote) |
|
|
|
voteCh := subscribe(cs.eventBus, types.EventQueryVote) |
|
|
|
|
|
|
|
cs.enterPrevote(height, round) |
|
|
|
cs.startRoutines(4) |
|
|
@ -382,7 +382,7 @@ func TestStateFullRound2(t *testing.T) { |
|
|
|
vs2 := vss[1] |
|
|
|
height, round := cs1.Height, cs1.Round |
|
|
|
|
|
|
|
voteCh := subscribeUnBuffered(cs1.eventBus, types.EventQueryVote) |
|
|
|
voteCh := subscribe(cs1.eventBus, types.EventQueryVote) |
|
|
|
newBlockCh := subscribe(cs1.eventBus, types.EventQueryNewBlock) |
|
|
|
|
|
|
|
// start round and wait for propose and prevote
|
|
|
@ -428,7 +428,7 @@ func TestStateLockNoPOL(t *testing.T) { |
|
|
|
|
|
|
|
timeoutProposeCh := subscribe(cs1.eventBus, types.EventQueryTimeoutPropose) |
|
|
|
timeoutWaitCh := subscribe(cs1.eventBus, types.EventQueryTimeoutWait) |
|
|
|
voteCh := subscribeUnBuffered(cs1.eventBus, types.EventQueryVote) |
|
|
|
voteCh := subscribe(cs1.eventBus, types.EventQueryVote) |
|
|
|
proposalCh := subscribe(cs1.eventBus, types.EventQueryCompleteProposal) |
|
|
|
newRoundCh := subscribe(cs1.eventBus, types.EventQueryNewRound) |
|
|
|
|
|
|
@ -1971,12 +1971,3 @@ func subscribe(eventBus *types.EventBus, q tmpubsub.Query) <-chan tmpubsub.Messa |
|
|
|
} |
|
|
|
return sub.Out() |
|
|
|
} |
|
|
|
|
|
|
|
// subscribe subscribes test client to the given query and returns a channel with cap = 0.
|
|
|
|
func subscribeUnBuffered(eventBus *types.EventBus, q tmpubsub.Query) <-chan tmpubsub.Message { |
|
|
|
sub, err := eventBus.SubscribeUnbuffered(context.Background(), testSubscriber, q) |
|
|
|
if err != nil { |
|
|
|
panic(fmt.Sprintf("failed to subscribe %s to %v", testSubscriber, q)) |
|
|
|
} |
|
|
|
return sub.Out() |
|
|
|
} |