mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 14:52:17 +00:00
blockchain: deduplicate store header value tests
This commit is contained in:
parent
05f30b3e28
commit
83b40b25d6
@ -128,6 +128,14 @@ func TestBlockStoreSaveLoadBlock(t *testing.T) {
|
|||||||
uncontiguousPartSet := types.NewPartSetFromHeader(types.PartSetHeader{Total: 0})
|
uncontiguousPartSet := types.NewPartSetFromHeader(types.PartSetHeader{Total: 0})
|
||||||
uncontiguousPartSet.AddPart(part2, false)
|
uncontiguousPartSet.AddPart(part2, false)
|
||||||
|
|
||||||
|
header1 := types.Header{
|
||||||
|
Height: 1,
|
||||||
|
NumTxs: 100,
|
||||||
|
ChainID: "block_test",
|
||||||
|
}
|
||||||
|
header2 := header1
|
||||||
|
header2.Height = 4
|
||||||
|
|
||||||
// End of setup, test data
|
// End of setup, test data
|
||||||
|
|
||||||
tuples := []struct {
|
tuples := []struct {
|
||||||
@ -145,11 +153,7 @@ func TestBlockStoreSaveLoadBlock(t *testing.T) {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
block: &types.Block{
|
block: &types.Block{
|
||||||
Header: &types.Header{
|
Header: &header1,
|
||||||
Height: 1,
|
|
||||||
NumTxs: 100,
|
|
||||||
ChainID: "block_test",
|
|
||||||
},
|
|
||||||
LastCommit: &types.Commit{Precommits: []*types.Vote{{Height: 10}}},
|
LastCommit: &types.Commit{Precommits: []*types.Vote{{Height: 10}}},
|
||||||
},
|
},
|
||||||
parts: validPartSet,
|
parts: validPartSet,
|
||||||
@ -163,11 +167,7 @@ func TestBlockStoreSaveLoadBlock(t *testing.T) {
|
|||||||
|
|
||||||
{
|
{
|
||||||
block: &types.Block{
|
block: &types.Block{
|
||||||
Header: &types.Header{
|
Header: &header2,
|
||||||
Height: 4,
|
|
||||||
NumTxs: 100,
|
|
||||||
ChainID: "block_test",
|
|
||||||
},
|
|
||||||
LastCommit: &types.Commit{Precommits: []*types.Vote{{Height: 10}}},
|
LastCommit: &types.Commit{Precommits: []*types.Vote{{Height: 10}}},
|
||||||
},
|
},
|
||||||
parts: uncontiguousPartSet,
|
parts: uncontiguousPartSet,
|
||||||
@ -176,11 +176,7 @@ func TestBlockStoreSaveLoadBlock(t *testing.T) {
|
|||||||
|
|
||||||
{
|
{
|
||||||
block: &types.Block{
|
block: &types.Block{
|
||||||
Header: &types.Header{
|
Header: &header1,
|
||||||
Height: 1,
|
|
||||||
NumTxs: 100,
|
|
||||||
ChainID: "block_test",
|
|
||||||
},
|
|
||||||
LastCommit: &types.Commit{Precommits: []*types.Vote{{Height: 10}}},
|
LastCommit: &types.Commit{Precommits: []*types.Vote{{Height: 10}}},
|
||||||
},
|
},
|
||||||
parts: incompletePartSet,
|
parts: incompletePartSet,
|
||||||
@ -189,11 +185,7 @@ func TestBlockStoreSaveLoadBlock(t *testing.T) {
|
|||||||
|
|
||||||
{
|
{
|
||||||
block: &types.Block{
|
block: &types.Block{
|
||||||
Header: &types.Header{
|
Header: &header1,
|
||||||
Height: 1,
|
|
||||||
NumTxs: 100,
|
|
||||||
ChainID: "block_test",
|
|
||||||
},
|
|
||||||
LastCommit: &types.Commit{Precommits: []*types.Vote{{Height: 10}}},
|
LastCommit: &types.Commit{Precommits: []*types.Vote{{Height: 10}}},
|
||||||
},
|
},
|
||||||
parts: validPartSet,
|
parts: validPartSet,
|
||||||
@ -204,11 +196,7 @@ func TestBlockStoreSaveLoadBlock(t *testing.T) {
|
|||||||
|
|
||||||
{
|
{
|
||||||
block: &types.Block{
|
block: &types.Block{
|
||||||
Header: &types.Header{
|
Header: &header1,
|
||||||
Height: 1,
|
|
||||||
NumTxs: 100,
|
|
||||||
ChainID: "block_test",
|
|
||||||
},
|
|
||||||
LastCommit: &types.Commit{Precommits: []*types.Vote{{Height: 10}}},
|
LastCommit: &types.Commit{Precommits: []*types.Vote{{Height: 10}}},
|
||||||
},
|
},
|
||||||
parts: validPartSet,
|
parts: validPartSet,
|
||||||
@ -219,11 +207,7 @@ func TestBlockStoreSaveLoadBlock(t *testing.T) {
|
|||||||
|
|
||||||
{
|
{
|
||||||
block: &types.Block{
|
block: &types.Block{
|
||||||
Header: &types.Header{
|
Header: &header1,
|
||||||
Height: 1,
|
|
||||||
NumTxs: 100,
|
|
||||||
ChainID: "block_test",
|
|
||||||
},
|
|
||||||
LastCommit: &types.Commit{Precommits: []*types.Vote{{Height: 10}}},
|
LastCommit: &types.Commit{Precommits: []*types.Vote{{Height: 10}}},
|
||||||
},
|
},
|
||||||
parts: validPartSet,
|
parts: validPartSet,
|
||||||
@ -235,11 +219,7 @@ func TestBlockStoreSaveLoadBlock(t *testing.T) {
|
|||||||
|
|
||||||
{
|
{
|
||||||
block: &types.Block{
|
block: &types.Block{
|
||||||
Header: &types.Header{
|
Header: &header1,
|
||||||
Height: 1,
|
|
||||||
NumTxs: 100,
|
|
||||||
ChainID: "block_test",
|
|
||||||
},
|
|
||||||
LastCommit: &types.Commit{Precommits: []*types.Vote{{Height: 10}}},
|
LastCommit: &types.Commit{Precommits: []*types.Vote{{Height: 10}}},
|
||||||
},
|
},
|
||||||
parts: validPartSet,
|
parts: validPartSet,
|
||||||
@ -251,11 +231,7 @@ func TestBlockStoreSaveLoadBlock(t *testing.T) {
|
|||||||
|
|
||||||
{
|
{
|
||||||
block: &types.Block{
|
block: &types.Block{
|
||||||
Header: &types.Header{
|
Header: &header1,
|
||||||
Height: 1,
|
|
||||||
NumTxs: 100,
|
|
||||||
ChainID: "block_test",
|
|
||||||
},
|
|
||||||
LastCommit: &types.Commit{Precommits: []*types.Vote{{Height: 10}}},
|
LastCommit: &types.Commit{Precommits: []*types.Vote{{Height: 10}}},
|
||||||
},
|
},
|
||||||
parts: validPartSet,
|
parts: validPartSet,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user