use more specific require statements

This commit is contained in:
William Banfield
2022-01-20 15:54:26 -05:00
parent dd0d273223
commit 02f7d0ae6e
2 changed files with 5 additions and 5 deletions
+2 -1
View File
@@ -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
}
+3 -4
View File
@@ -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)
}