Remove fatal from pkg

* Functions in pkg should return errors
 * If aborting is desired, that behavior should be left to the consumer
This commit is contained in:
Eric Meyer
2017-12-04 09:54:39 -06:00
parent 7a11d3c50f
commit 655d1b1d6f
8 changed files with 31 additions and 26 deletions
+1 -3
View File
@@ -9,7 +9,6 @@ import (
"github.com/8thlight/vulcanizedb/cmd"
"github.com/8thlight/vulcanizedb/pkg/geth"
"github.com/8thlight/vulcanizedb/pkg/repositories"
"github.com/8thlight/vulcanizedb/pkg/watched_contracts"
)
@@ -18,9 +17,8 @@ func main() {
contractHash := flag.String("contract-hash", "", "Contract hash to show summary")
flag.Parse()
config := cmd.LoadConfig(*environment)
blockchain := geth.NewGethBlockchain(config.Client.IPCPath)
repository := repositories.NewPostgres(config.Database)
repository := cmd.LoadPostgres(config.Database)
contractSummary, err := watched_contracts.NewSummary(blockchain, repository, *contractHash)
if err != nil {
log.Fatalln(err)