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 /blockdb/level-db_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 'blockdb/level-db_test.go')
-rw-r--r-- | blockdb/level-db_test.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/blockdb/level-db_test.go b/blockdb/level-db_test.go index f6c14c5..d1c8146 100644 --- a/blockdb/level-db_test.go +++ b/blockdb/level-db_test.go @@ -55,7 +55,9 @@ func (s *LevelDBTestSuite) TestBasicUsage() { block1 := types.Block{ ProposerID: validator1, Hash: hash1, - Height: 1, + Position: types.Position{ + Height: 1, + }, } err = db.Update(block1) s.Equal(ErrBlockDoesNotExist, err) @@ -102,7 +104,9 @@ func (s *LevelDBTestSuite) TestSyncIndex() { block := types.Block{ ProposerID: types.ValidatorID{Hash: common.NewRandomHash()}, Hash: common.NewRandomHash(), - Height: uint64(i), + Position: types.Position{ + Height: uint64(i), + }, } db.Put(block) blocks[i] = block @@ -121,7 +125,7 @@ func (s *LevelDBTestSuite) TestSyncIndex() { queried, err := db.Get(block.Hash) s.Nil(err) s.Equal(block.ProposerID, queried.ProposerID) - s.Equal(block.Height, queried.Height) + s.Equal(block.Position.Height, queried.Position.Height) } } |