htlcswitch: add test for integrated control tower

This commit is contained in:
Vadym Popov authored and Conner Fromknecht committed 2018-08-21 19:23:22 -07:00
1 parent 21fc7aa829
commit 033fd3c83d
3 files changed
+26 -35

No files matched your search

+19 -7
View File
@@ -124,14 +124,26 @@ type mockServer struct {
var _ lnpeer.Peer = (*mockServer)(nil)
func initSwitchWithDB(startingHeight uint32, db *channeldb.DB) (*Switch, error) {
if db == nil {
tempPath, err := ioutil.TempDir("", "switchdb")
if err != nil {
return nil, err
}
func initDB() (*channeldb.DB, error) {
tempPath, err := ioutil.TempDir("", "switchdb")
if err != nil {
return nil, err
}
db, err = channeldb.Open(tempPath)
db, err := channeldb.Open(tempPath)
if err != nil {
return nil, err
}
return db, err
}
func initSwitchWithDB(startingHeight uint32, db *channeldb.DB) (*Switch, error) {
var err error
if db == nil {
db, err = initDB()
if err != nil {
return nil, err
}