ADR-016: Add versions to Block and State (#2644)

* types: add Version to Header

* abci: add Version to Header

* state: add Version to State

* node: check software and state protocol versions match

* update changelog

* docs/spec: update for versions

* state: more tests

* remove TODOs

* remove empty test
This commit is contained in:
Ethan Buchman
2018-10-17 15:30:53 -04:00
committed by GitHub
parent 6a07f415e9
commit 455d34134c
17 changed files with 999 additions and 504 deletions

View File

@@ -12,6 +12,7 @@ import (
"github.com/tendermint/tendermint/crypto/tmhash"
cmn "github.com/tendermint/tendermint/libs/common"
"github.com/tendermint/tendermint/version"
)
func TestMain(m *testing.M) {
@@ -242,6 +243,7 @@ func TestMaxHeaderBytes(t *testing.T) {
}
h := Header{
Version: version.Consensus{math.MaxInt64, math.MaxInt64},
ChainID: maxChainID,
Height: math.MaxInt64,
Time: time.Now().UTC(),
@@ -286,9 +288,9 @@ func TestBlockMaxDataBytes(t *testing.T) {
}{
0: {-10, 1, 0, true, 0},
1: {10, 1, 0, true, 0},
2: {721, 1, 0, true, 0},
3: {722, 1, 0, false, 0},
4: {723, 1, 0, false, 1},
2: {744, 1, 0, true, 0},
3: {745, 1, 0, false, 0},
4: {746, 1, 0, false, 1},
}
for i, tc := range testCases {
@@ -314,9 +316,9 @@ func TestBlockMaxDataBytesUnknownEvidence(t *testing.T) {
}{
0: {-10, 1, true, 0},
1: {10, 1, true, 0},
2: {801, 1, true, 0},
3: {802, 1, false, 0},
4: {803, 1, false, 1},
2: {826, 1, true, 0},
3: {827, 1, false, 0},
4: {828, 1, false, 1},
}
for i, tc := range testCases {