JSON tests related changes (#4461)

* test functions take time.Now and other minor changes

* updated remaining test files

* Update validation_test.go

* fix typo

* go fmt

* import time

Co-authored-by: Marko <marbar3778@yahoo.com>
This commit is contained in:
Shivani Joshi
2020-02-28 09:57:00 +01:00
committed by GitHub
co-authored by Marko
parent 3f883bb80a
commit 78144306dd
11 changed files with 52 additions and 38 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ func makeValidCommit(
sigs := make([]types.CommitSig, 0)
for i := 0; i < vals.Size(); i++ {
_, val := vals.GetByIndex(i)
vote, err := types.MakeVote(height, blockID, vals, privVals[val.Address.String()], chainID)
vote, err := types.MakeVote(height, blockID, vals, privVals[val.Address.String()], chainID, time.Now())
if err != nil {
return nil, err
}
+8 -1
View File
@@ -117,6 +117,7 @@ func TestValidateBlockCommit(t *testing.T) {
state.Validators,
privVals[proposerAddr.String()],
chainID,
time.Now(),
)
require.NoError(t, err, "height %d", height)
wrongHeightCommit := types.NewCommit(
@@ -162,7 +163,13 @@ func TestValidateBlockCommit(t *testing.T) {
/*
wrongSigsCommit is fine except for the extra bad precommit
*/
goodVote, err := types.MakeVote(height, blockID, state.Validators, privVals[proposerAddr.String()], chainID)
goodVote, err := types.MakeVote(height,
blockID,
state.Validators,
privVals[proposerAddr.String()],
chainID,
time.Now(),
)
require.NoError(t, err, "height %d", height)
badVote := &types.Vote{
ValidatorAddress: badPrivVal.GetPubKey().Address(),