diff --git a/internal/consensus/common_test.go b/internal/consensus/common_test.go index b7b5e2a8c..e2f11b566 100644 --- a/internal/consensus/common_test.go +++ b/internal/consensus/common_test.go @@ -594,7 +594,7 @@ func ensureNewTimeout(t *testing.T, timeoutCh <-chan tmpubsub.Message, height in ensureNewEvent(t, timeoutCh, height, round, timeoutDuration) } -func ensureNewProposal(t *testing.T, proposalCh <-chan tmpubsub.Message, height int64, round int32) { +func ensureNewProposal(t *testing.T, proposalCh <-chan tmpubsub.Message, height int64, round int32) types.BlockID { t.Helper() msg := ensureMessageBeforeTimeout(t, proposalCh, ensureTimeout) proposalEvent, ok := msg.Data().(types.EventDataCompleteProposal) @@ -602,6 +602,7 @@ func ensureNewProposal(t *testing.T, proposalCh <-chan tmpubsub.Message, height msg.Data()) require.Equal(t, height, proposalEvent.Height) require.Equal(t, round, proposalEvent.Round) + return proposalEvent.BlockID } func ensureNewValidBlock(t *testing.T, validBlockCh <-chan tmpubsub.Message, height int64, round int32) { diff --git a/internal/consensus/state_test.go b/internal/consensus/state_test.go index 10adbccaa..c35a3cc6a 100644 --- a/internal/consensus/state_test.go +++ b/internal/consensus/state_test.go @@ -343,9 +343,7 @@ func TestStateFullRound1(t *testing.T) { cs, vss := makeState(ctx, t, config, logger, 1) height, round := cs.Height, cs.Round - pv, err := cs.privValidator.GetPubKey(ctx) - require.NoError(t, err) - voteCh := subscribeToVoter(ctx, t, cs, pv.Address()) + voteCh := subscribe(ctx, t, cs.eventBus, types.EventQueryVote) propCh := subscribe(ctx, t, cs.eventBus, types.EventQueryCompleteProposal) newRoundCh := subscribe(ctx, t, cs.eventBus, types.EventQueryNewRound) @@ -354,17 +352,16 @@ func TestStateFullRound1(t *testing.T) { ensureNewRound(t, newRoundCh, height, round) - ensureNewProposal(t, propCh, height, round) - propBlockHash := cs.GetRoundState().ProposalBlock.Hash() + propBlock := ensureNewProposal(t, propCh, height, round) - ensurePrevoteMatch(t, voteCh, height, round, propBlockHash) // wait for prevote + ensurePrevoteMatch(t, voteCh, height, round, propBlock.Hash) // wait for prevote ensurePrecommit(t, voteCh, height, round) // wait for precommit // we're going to roll right into new height ensureNewRound(t, newRoundCh, height+1, 0) - validateLastPrecommit(ctx, t, cs, vss[0], propBlockHash) + validateLastPrecommit(ctx, t, cs, vss[0], propBlock.Hash) } // nil is proposed, so prevote and precommit nil