diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-09-03 10:01:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-03 10:01:40 +0800 |
commit | c8d3092208f73ee991a123052a71b7dbf7fffc27 (patch) | |
tree | fdcb3b90b859531e042dbbdd6bcd7b0cca40e86a /core/test/blocks-generator_test.go | |
parent | 9491ddae81640e04f8aed38e2cddeb64cc62d55b (diff) | |
download | dexon-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.go | 8 |
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) } |