btc converter, publisher, and indexer unit tests

This commit is contained in:
Ian Norden
2020-02-20 16:14:17 -06:00
parent 8643a7f3b6
commit 642e08a04b
29 changed files with 1286 additions and 171 deletions
-6
View File
@@ -18,7 +18,6 @@ package shared
import (
"bytes"
"reflect"
)
// ListContainsString used to check if a list of strings contains a particular string
@@ -50,8 +49,3 @@ func ListContainsGap(gapList []Gap, gap Gap) bool {
}
return false
}
// IsPointer returns true if the concrete type underneath the provided interface is a pointer
func IsPointer(i interface{}) bool {
return reflect.ValueOf(i).Type().Kind() == reflect.Ptr
}
+32
View File
@@ -0,0 +1,32 @@
// VulcanizeDB
// Copyright © 2019 Vulcanize
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package shared
import (
"github.com/vulcanize/vulcanizedb/pkg/config"
"github.com/vulcanize/vulcanizedb/pkg/eth/core"
"github.com/vulcanize/vulcanizedb/pkg/eth/datastore/postgres"
)
// SetupDB is use to setup a db for super node tests
func SetupDB() (*postgres.DB, error) {
return postgres.NewDB(config.Database{
Hostname: "localhost",
Name: "vulcanize_testing",
Port: 5432,
}, core.Node{})
}