Add sync interface

This commit is contained in:
Arnau B
2020-08-20 16:17:14 +02:00
parent 87a74c471a
commit 1cbf54acc7
6 changed files with 118 additions and 16 deletions

View File

@@ -44,7 +44,7 @@ func TestAddBlock(t *testing.T) {
fromBlock = 1
toBlock = 5
// Delete peviously created rows (clean previous test execs)
assert.NoError(t, historyDB.reorg(fromBlock-1))
assert.NoError(t, historyDB.Reorg(fromBlock-1))
// Generate fake blocks
blocks := genBlocks(fromBlock, toBlock)
// Insert blocks into DB
@@ -95,11 +95,11 @@ func TestBids(t *testing.T) {
// setTestBlocks WARNING: this will delete the blocks and recreate them
func setTestBlocks(from, to uint64) {
if from == 0 {
if err := historyDB.reorg(from); err != nil {
if err := historyDB.Reorg(from); err != nil {
panic(err)
}
} else {
if err := historyDB.reorg(from - 1); err != nil {
if err := historyDB.Reorg(from - 1); err != nil {
panic(err)
}
}