mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-28 18:55:42 +00:00
ensureProposal returns proposed blockID
This commit is contained in:
@@ -587,7 +587,7 @@ func ensureNewTimeout(t *testing.T, timeoutCh <-chan tmpubsub.Message, height in
|
|||||||
"Timeout expired while waiting for NewTimeout event")
|
"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()
|
t.Helper()
|
||||||
select {
|
select {
|
||||||
case <-time.After(ensureTimeout):
|
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, height, proposalEvent.Height)
|
||||||
require.Equal(t, round, proposalEvent.Round)
|
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) {
|
func ensureNewValidBlock(t *testing.T, validBlockCh <-chan tmpubsub.Message, height int64, round int32) {
|
||||||
|
|||||||
@@ -367,18 +367,16 @@ func TestStateFullRound1(t *testing.T) {
|
|||||||
|
|
||||||
ensureNewRound(t, newRoundCh, height, round)
|
ensureNewRound(t, newRoundCh, height, round)
|
||||||
|
|
||||||
ensureNewProposal(t, propCh, height, round)
|
propBlock := ensureNewProposal(t, propCh, height, round)
|
||||||
propBlockHash := cs.GetRoundState().ProposalBlock.Hash()
|
|
||||||
require.NotNil(t, propBlockHash)
|
|
||||||
|
|
||||||
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
|
ensurePrecommit(t, voteCh, height, round) // wait for precommit
|
||||||
|
|
||||||
// we're going to roll right into new height
|
// we're going to roll right into new height
|
||||||
ensureNewRound(t, newRoundCh, height+1, 0)
|
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
|
// nil is proposed, so prevote and precommit nil
|
||||||
|
|||||||
Reference in New Issue
Block a user