From 9adbd50808aff08b367edd326f696025148e7373 Mon Sep 17 00:00:00 2001 From: Anca Zamfir Date: Tue, 21 Dec 2021 20:34:25 +0100 Subject: [PATCH] Cleanup --- internal/consensus/common_test.go | 2 +- internal/consensus/pbts_test.go | 2 +- internal/consensus/state.go | 5 +---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/internal/consensus/common_test.go b/internal/consensus/common_test.go index 11ad9c1e4..3c0c72757 100644 --- a/internal/consensus/common_test.go +++ b/internal/consensus/common_test.go @@ -41,7 +41,7 @@ const ( testSubscriber = "test-client" // genesis, chain_id, priv_val - ensureTimeout = 200 * time.Millisecond + ensureTimeout = time.Millisecond * 200 ) // A cleanupFunc cleans up any config / test files created for a particular diff --git a/internal/consensus/pbts_test.go b/internal/consensus/pbts_test.go index f97aecf3b..a6b4d6061 100644 --- a/internal/consensus/pbts_test.go +++ b/internal/consensus/pbts_test.go @@ -335,7 +335,7 @@ func TestProposerWaitsForGenesisTime(t *testing.T) { cfg := pbtsTestConfiguration{ timingParams: types.TimingParams{ Precision: 10 * time.Millisecond, - MessageDelay: 100 * time.Millisecond, + MessageDelay: 10 * time.Millisecond, }, timeoutPropose: 10 * time.Millisecond, genesisTime: initialTime, diff --git a/internal/consensus/state.go b/internal/consensus/state.go index 5b9f4c017..7b0ab3b19 100644 --- a/internal/consensus/state.go +++ b/internal/consensus/state.go @@ -1317,10 +1317,7 @@ func (cs *State) proposalIsTimely(proposal *types.Proposal) bool { MessageDelay: cs.state.ConsensusParams.Timing.MessageDelay, } - if !proposal.IsTimely(tmtime.DefaultSource{}, tp, cs.state.InitialHeight) { - return false - } - return true + return proposal.IsTimely(tmtime.DefaultSource{}, tp, cs.state.InitialHeight) } func (cs *State) defaultDoPrevote(height int64, round int32) {