fix testing

This commit is contained in:
Jeffrey Picard 2022-10-03 10:16:23 +00:00
parent 0bcb069e04
commit f086dd0d57
2 changed files with 8 additions and 1 deletions

View file

@ -606,6 +606,8 @@ func GetDBColumnFamilies(name string, secondayPath string, cfNames []string) (*R
LastState: nil,
Height: 0,
Headers: nil,
OpenIterators: make(map[string][]chan struct{}),
ItMut: sync.RWMutex{},
ShutdownChan: make(chan struct{}, 1),
DoneChan: make(chan struct{}, 1),
}
@ -1080,7 +1082,7 @@ func GenerateTestData(prefix byte, fileName string) {
log.Fatalln(err)
}
options := NewIterateOptions().WithDB(db)
options := NewIterateOptions()
options.WithRawKey(true).WithRawValue(true).WithIncludeValue(true)
options.WithPrefix([]byte{prefix})

View file

@ -7,6 +7,7 @@ import (
"log"
"os"
"strings"
"sync"
"testing"
dbpkg "github.com/lbryio/herald.go/db"
@ -93,6 +94,10 @@ func OpenAndFillTmpDBColumnFamlies(filePath string) (*dbpkg.ReadOnlyDBColumnFami
LastState: nil,
Height: 0,
Headers: nil,
OpenIterators: make(map[string][]chan struct{}),
ItMut: sync.RWMutex{},
ShutdownChan: make(chan struct{}, 1),
DoneChan: make(chan struct{}, 1),
}
// err = dbpkg.ReadDBState(myDB) //TODO: Figure out right place for this