aboutsummaryrefslogtreecommitdiffstats
path: root/blockdb/level-db_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 /blockdb/level-db_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 'blockdb/level-db_test.go')
-rw-r--r--blockdb/level-db_test.go10
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)
}
}