diff --git a/internal/consensus/common_test.go b/internal/consensus/common_test.go index e21193434..8fc072f79 100644 --- a/internal/consensus/common_test.go +++ b/internal/consensus/common_test.go @@ -587,7 +587,7 @@ func ensureNewTimeout(t *testing.T, timeoutCh <-chan tmpubsub.Message, height in "Timeout expired while waiting for NewTimeout event") } -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() select { case <-time.After(ensureTimeout): @@ -599,7 +599,9 @@ func ensureNewProposal(t *testing.T, proposalCh <-chan tmpubsub.Message, height require.Equal(t, height, proposalEvent.Height) require.Equal(t, round, proposalEvent.Round) + return proposalEvent.BlockID } + return types.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 09c58b3d7..c9ffc4d34 100644 --- a/internal/consensus/state_test.go +++ b/internal/consensus/state_test.go @@ -367,18 +367,16 @@ func TestStateFullRound1(t *testing.T) { ensureNewRound(t, newRoundCh, height, round) - ensureNewProposal(t, propCh, height, round) - propBlockHash := cs.GetRoundState().ProposalBlock.Hash() - require.NotNil(t, propBlockHash) + 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