From 02f7d0ae6e5f17707bac6445ab9d7b5b9a16095a Mon Sep 17 00:00:00 2001 From: William Banfield Date: Thu, 20 Jan 2022 15:54:26 -0500 Subject: [PATCH] use more specific require statements --- internal/consensus/common_test.go | 3 ++- internal/consensus/pbts_test.go | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/consensus/common_test.go b/internal/consensus/common_test.go index 5afc12953..8ab89d68e 100644 --- a/internal/consensus/common_test.go +++ b/internal/consensus/common_test.go @@ -869,7 +869,8 @@ func makeGenesisState(t *testing.T, cfg *config.Config, args genesisStateArgs) ( args.Time = time.Now() } genDoc := factory.GenesisDoc(cfg, args.Time, valSet.Validators, args.Params) - s0, _ := sm.MakeGenesisState(genDoc) + s0, err := sm.MakeGenesisState(genDoc) + require.NoError(t, err) return s0, privValidators } diff --git a/internal/consensus/pbts_test.go b/internal/consensus/pbts_test.go index 7e6f1d717..aacd07765 100644 --- a/internal/consensus/pbts_test.go +++ b/internal/consensus/pbts_test.go @@ -441,7 +441,7 @@ func TestTimelyProposal(t *testing.T) { pbtsTest := newPBTSTestHarness(ctx, t, cfg) results := pbtsTest.run() - assert.True(t, results.height2.prevote.BlockID.Hash != nil) + require.NotNil(t, results.height2.prevote.BlockID.Hash) } func TestTooFarInThePastProposal(t *testing.T) { @@ -464,9 +464,8 @@ func TestTooFarInThePastProposal(t *testing.T) { pbtsTest := newPBTSTestHarness(ctx, t, cfg) results := pbtsTest.run() - time.Sleep(1 * time.Second) - assert.True(t, results.height2.prevote.BlockID.Hash == nil) + require.Nil(t, results.height2.prevote.BlockID.Hash) } func TestTooFarInTheFutureProposal(t *testing.T) { @@ -491,5 +490,5 @@ func TestTooFarInTheFutureProposal(t *testing.T) { pbtsTest := newPBTSTestHarness(ctx, t, cfg) results := pbtsTest.run() - assert.True(t, results.height2.prevote.BlockID.Hash == nil) + require.Nil(t, results.height2.prevote.BlockID.Hash) }