aboutsummaryrefslogtreecommitdiffstats
path: root/core/test/blocks-generator_test.go
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2018-09-03 10:01:40 +0800
committerGitHub <noreply@github.com>2018-09-03 10:01:40 +0800
commitc8d3092208f73ee991a123052a71b7dbf7fffc27 (patch)
treefdcb3b90b859531e042dbbdd6bcd7b0cca40e86a /core/test/blocks-generator_test.go
parent9491ddae81640e04f8aed38e2cddeb64cc62d55b (diff)
downloaddexon-consensus-c8d3092208f73ee991a123052a71b7dbf7fffc27.tar
dexon-consensus-c8d3092208f73ee991a123052a71b7dbf7fffc27.tar.gz
dexon-consensus-c8d3092208f73ee991a123052a71b7dbf7fffc27.tar.bz2
dexon-consensus-c8d3092208f73ee991a123052a71b7dbf7fffc27.tar.lz
dexon-consensus-c8d3092208f73ee991a123052a71b7dbf7fffc27.tar.xz
dexon-consensus-c8d3092208f73ee991a123052a71b7dbf7fffc27.tar.zst
dexon-consensus-c8d3092208f73ee991a123052a71b7dbf7fffc27.zip
core: Add a new structure `Position` and move `ShardID`, `ChainID` and `Height` from `Block` (#89)
Diffstat (limited to 'core/test/blocks-generator_test.go')
-rw-r--r--core/test/blocks-generator_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/test/blocks-generator_test.go b/core/test/blocks-generator_test.go
index 5c85fbd..b144100 100644
--- a/core/test/blocks-generator_test.go
+++ b/core/test/blocks-generator_test.go
@@ -74,7 +74,7 @@ func (s *BlocksGeneratorTestCase) TestGenerate() {
// Check genesis block.
genesisBlock := blocks[0]
s.Equal(genesisBlock.ParentHash, common.Hash{})
- s.Equal(genesisBlock.Height, uint64(0))
+ s.Equal(genesisBlock.Position.Height, uint64(0))
s.Empty(genesisBlock.Acks)
// Check normal blocks.
@@ -90,14 +90,14 @@ func (s *BlocksGeneratorTestCase) TestGenerate() {
prevAckingHeight, exists :=
lastAckingHeights[ackedBlock.ProposerID]
if exists {
- s.True(prevAckingHeight < ackedBlock.Height)
+ s.True(prevAckingHeight < ackedBlock.Position.Height)
}
- lastAckingHeights[ackedBlock.ProposerID] = ackedBlock.Height
+ lastAckingHeights[ackedBlock.ProposerID] = ackedBlock.Position.Height
// Block Height should always incremental by 1.
//
// Because we iterate blocks slice from 1,
// we need to add 1 to the index.
- s.Equal(block.Height, uint64(index+1))
+ s.Equal(block.Position.Height, uint64(index+1))
}
s.True(parentAcked)
}