From c8d3092208f73ee991a123052a71b7dbf7fffc27 Mon Sep 17 00:00:00 2001 From: Jimmy Hu Date: Mon, 3 Sep 2018 10:01:40 +0800 Subject: core: Add a new structure `Position` and move `ShardID`, `ChainID` and `Height` from `Block` (#89) --- core/test/blocks-generator_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'core/test/blocks-generator_test.go') 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) } -- cgit v1.2.3