remove TimeIotaMs from ABCI consensus params (#3403)

Also

- init substructures to avoid panic in pb2tm.ConsensusParams
Before: if csp.Block is nil and we later try to access/write to it,
we'll panic.
After: if csp.Block is nil and we later try to access/write to it,
there'll be no panic.
This commit is contained in:
Anton Kaliaev
2019-03-11 22:21:17 +04:00
committed by GitHub
parent dc359bd3a5
commit 15f621141d
10 changed files with 209 additions and 252 deletions

View File

@ -65,6 +65,8 @@ func TestABCIConsensusParams(t *testing.T) {
cp := DefaultConsensusParams()
abciCP := TM2PB.ConsensusParams(cp)
cp2 := PB2TM.ConsensusParams(abciCP)
// TimeIotaMs is not exposed to the application.
cp2.Block.TimeIotaMs = cp.Block.TimeIotaMs
assert.Equal(t, *cp, cp2)
}