aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-07-31 18:46:24 +0800
committerGitHub <noreply@github.com>2018-07-31 18:46:24 +0800
commit3778e956013cad171cd5954686831e2598de3045 (patch)
treef1d38286fc55dbf20def9a49a67449961ce89b44 /core
parentc9cf5953512e4503f4781d6a441404ff9dfe5660 (diff)
downloaddexon-consensus-3778e956013cad171cd5954686831e2598de3045.tar
dexon-consensus-3778e956013cad171cd5954686831e2598de3045.tar.gz
dexon-consensus-3778e956013cad171cd5954686831e2598de3045.tar.bz2
dexon-consensus-3778e956013cad171cd5954686831e2598de3045.tar.lz
dexon-consensus-3778e956013cad171cd5954686831e2598de3045.tar.xz
dexon-consensus-3778e956013cad171cd5954686831e2598de3045.tar.zst
dexon-consensus-3778e956013cad171cd5954686831e2598de3045.zip
blockdb: allow to dump blocks to json-encoded file
- Allow to dump blockdb to a json file - Compared to leveldb, a json file is easier to trace. - Add interfaces block database: - Close would be required by database that needs cleanup. - BlockIterator is required when we need to access 'all' blocks, adding a new method 'GetAll' as the constructor for iterators. - Remove GetByValidatorAndHeight from blockdb.Reader - This function is not used anywhere, to make interface minimum, remove it. - Fix typo: backend -> backed
Diffstat (limited to 'core')
-rw-r--r--core/blocklattice_test.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/blocklattice_test.go b/core/blocklattice_test.go
index 3dd5a3b..0f78dc5 100644
--- a/core/blocklattice_test.go
+++ b/core/blocklattice_test.go
@@ -68,7 +68,9 @@ func (s *BlockLatticeTest) SetupTest() {
s.app = &TestApp{}
- lattice = NewBlockLattice(blockdb.NewMemBackedBlockDB(), s.app)
+ db, err := blockdb.NewMemBackedBlockDB()
+ s.Require().Nil(err)
+ lattice = NewBlockLattice(db, s.app)
for i := 0; i < 4; i++ {
validators = append(validators,