diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-10-23 09:43:24 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-23 09:43:24 +0800 |
commit | 56cbbbaf4c638264cbf3ceb5cf16161b6adf2bc3 (patch) | |
tree | d52155ea22e6bcfae6ac062893c32186005c362f /core/lattice-data_test.go | |
parent | 6fbd0cd47fd70cfad707e95bc9fb948e7b44d4cf (diff) | |
download | dexon-consensus-56cbbbaf4c638264cbf3ceb5cf16161b6adf2bc3.tar.gz dexon-consensus-56cbbbaf4c638264cbf3ceb5cf16161b6adf2bc3.tar.zst dexon-consensus-56cbbbaf4c638264cbf3ceb5cf16161b6adf2bc3.zip |
core: prepare empty block if null block is confirmed by BA. (#231)
Diffstat (limited to 'core/lattice-data_test.go')
-rw-r--r-- | core/lattice-data_test.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/lattice-data_test.go b/core/lattice-data_test.go index 263474c..64767e1 100644 --- a/core/lattice-data_test.go +++ b/core/lattice-data_test.go @@ -577,6 +577,18 @@ func (s *LatticeDataTestSuite) TestNextPosition() { s.Equal(data.nextPosition(0), types.Position{ChainID: 0, Height: 0}) } +func (s *LatticeDataTestSuite) TestPrepareEmptyBlock() { + data, _ := s.genTestCase1() + b := &types.Block{ + Position: types.Position{ + ChainID: 0, + }, + } + data.prepareEmptyBlock(b) + s.True(b.IsEmpty()) + s.Equal(uint64(4), b.Position.Height) +} + func (s *LatticeDataTestSuite) TestNumChainsChange() { // This test case verify the behavior when NumChains // changes. We only reply on methods of latticeData |