types: refactor PB2TM.ConsensusParams to take BlockTimeIota as an arg (#3442)

See https://github.com/tendermint/tendermint/pull/3403/files#r266208947

In #3403 we unexposed BlockTimeIota from the ABCI, but it's still part
of the ConsensusParams struct, so we have to remember to add it back
after calling PB2TM.ConsensusParams. Instead, PB2TM.ConsensusParams
should take it as an argument

Fixes #3432
This commit is contained in:
Anton Kaliaev
2019-03-19 11:38:32 +04:00
committed by GitHub
parent 7457133307
commit 4162ebe8b5
3 changed files with 8 additions and 12 deletions

View File

@ -64,9 +64,7 @@ func TestABCIValidators(t *testing.T) {
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
cp2 := PB2TM.ConsensusParams(abciCP, cp.Block.TimeIotaMs)
assert.Equal(t, *cp, cp2)
}