ipld-eth-server/pkg/repositories/postgres/helpers.go
Matt K ed907535e3 Separate DB access into several repos (#28)
* Separate files for InMemory

* Start using separate repos for collaborating objects

* Before Updating schema

* Separate various repos
2018-02-12 10:54:05 -06:00

23 lines
526 B
Go

package postgres
import (
"github.com/vulcanize/vulcanizedb/pkg/config"
"github.com/vulcanize/vulcanizedb/pkg/core"
)
func (db *DB) clearData() {
db.MustExec("DELETE FROM watched_contracts")
db.MustExec("DELETE FROM transactions")
db.MustExec("DELETE FROM blocks")
db.MustExec("DELETE FROM logs")
db.MustExec("DELETE FROM receipts")
db.MustExec("DELETE FROM log_filters")
}
func NewTestDB(node core.Node) *DB {
cfg, _ := config.NewConfig("private")
db, _ := NewDB(cfg.Database, node)
db.clearData()
return db
}