diff options
author | Mission Liao <mission.liao@dexon.org> | 2018-07-31 18:46:24 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-31 18:46:24 +0800 |
commit | 3778e956013cad171cd5954686831e2598de3045 (patch) | |
tree | f1d38286fc55dbf20def9a49a67449961ce89b44 /core | |
parent | c9cf5953512e4503f4781d6a441404ff9dfe5660 (diff) | |
download | tangerine-consensus-3778e956013cad171cd5954686831e2598de3045.tar tangerine-consensus-3778e956013cad171cd5954686831e2598de3045.tar.gz tangerine-consensus-3778e956013cad171cd5954686831e2598de3045.tar.bz2 tangerine-consensus-3778e956013cad171cd5954686831e2598de3045.tar.lz tangerine-consensus-3778e956013cad171cd5954686831e2598de3045.tar.xz tangerine-consensus-3778e956013cad171cd5954686831e2598de3045.tar.zst tangerine-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.go | 4 |
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, |