Clean up files after rebase

This commit is contained in:
yaoandrew 2019-10-29 21:54:42 -07:00 committed by Ian Norden
parent 614ea3bba1
commit 5a1f599a4d
3 changed files with 22 additions and 25 deletions

View File

@ -143,7 +143,7 @@ func prepConfig() {
names := viper.GetStringSlice("exporter.transformerNames") names := viper.GetStringSlice("exporter.transformerNames")
transformers := make(map[string]config.Transformer) transformers := make(map[string]config.Transformer)
for _, name := range names { for _, name := range names {
LogWithCommand.Debug("Configuring " + name + " transformer") logWithCommand.Debug("Configuring " + name + " transformer")
transformer := viper.GetStringMapString("exporter." + name) transformer := viper.GetStringMapString("exporter." + name)
p, pOK := transformer["path"] p, pOK := transformer["path"]
if !pOK || p == "" { if !pOK || p == "" {

View File

@ -18,6 +18,7 @@ package watcher
import ( import (
"fmt" "fmt"
"strconv"
"time" "time"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
@ -123,7 +124,7 @@ func (storageWatcher StorageWatcher) processRow(diff utils.StorageDiff) {
} }
return return
} }
logrus.Debug("Storage diff persisted at block height: " + strconv.Itoa(row.BlockHeight)) logrus.Debug("Storage diff persisted at block height: " + strconv.Itoa(diff.BlockHeight))
} }
func (storageWatcher StorageWatcher) processQueue() { func (storageWatcher StorageWatcher) processQueue() {

View File

@ -17,13 +17,9 @@
package config package config
import ( import (
<<<<<<< HEAD
"strings" "strings"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
=======
"github.com/sirupsen/logrus"
>>>>>>> Removes import alias for logrus
"github.com/spf13/viper" "github.com/spf13/viper"
"github.com/vulcanize/vulcanizedb/pkg/eth" "github.com/vulcanize/vulcanizedb/pkg/eth"
) )
@ -95,16 +91,16 @@ func (contractConfig *ContractConfig) PrepConfig() {
var abi string var abi string
abiInterface, abiOK := transformer["abi"] abiInterface, abiOK := transformer["abi"]
if !abiOK { if !abiOK {
logrus.Warnf("contract %s not configured with an ABI, will attempt to fetch it from Etherscan\r\n", addr) log.Warnf("contract %s not configured with an ABI, will attempt to fetch it from Etherscan\r\n", addr)
} else { } else {
abi, abiOK = abiInterface.(string) abi, abiOK = abiInterface.(string)
if !abiOK { if !abiOK {
logrus.Fatal(addr, "transformer `abi` not of type []string") log.Fatal(addr, "transformer `abi` not of type []string")
} }
} }
if abi != "" { if abi != "" {
if _, abiErr := eth.ParseAbi(abi); abiErr != nil { if _, abiErr := eth.ParseAbi(abi); abiErr != nil {
logrus.Fatal(addr, "transformer `abi` not valid JSON") log.Fatal(addr, "transformer `abi` not valid JSON")
} }
} }
contractConfig.Abis[strings.ToLower(addr)] = abi contractConfig.Abis[strings.ToLower(addr)] = abi
@ -113,17 +109,17 @@ func (contractConfig *ContractConfig) PrepConfig() {
events := make([]string, 0) events := make([]string, 0)
eventsInterface, eventsOK := transformer["events"] eventsInterface, eventsOK := transformer["events"]
if !eventsOK { if !eventsOK {
logrus.Warnf("contract %s not configured with a list of events to watch, will watch all events\r\n", addr) log.Warnf("contract %s not configured with a list of events to watch, will watch all events\r\n", addr)
events = []string{} events = []string{}
} else { } else {
eventsI, eventsOK := eventsInterface.([]interface{}) eventsI, eventsOK := eventsInterface.([]interface{})
if !eventsOK { if !eventsOK {
logrus.Fatal(addr, "transformer `events` not of type []string\r\n") log.Fatal(addr, "transformer `events` not of type []string\r\n")
} }
for _, strI := range eventsI { for _, strI := range eventsI {
str, strOK := strI.(string) str, strOK := strI.(string)
if !strOK { if !strOK {
logrus.Fatal(addr, "transformer `events` not of type []string\r\n") log.Fatal(addr, "transformer `events` not of type []string\r\n")
} }
events = append(events, str) events = append(events, str)
} }
@ -134,17 +130,17 @@ func (contractConfig *ContractConfig) PrepConfig() {
methods := make([]string, 0) methods := make([]string, 0)
methodsInterface, methodsOK := transformer["methods"] methodsInterface, methodsOK := transformer["methods"]
if !methodsOK { if !methodsOK {
logrus.Warnf("contract %s not configured with a list of methods to poll, will not poll any methods\r\n", addr) log.Warnf("contract %s not configured with a list of methods to poll, will not poll any methods\r\n", addr)
methods = []string{} methods = []string{}
} else { } else {
methodsI, methodsOK := methodsInterface.([]interface{}) methodsI, methodsOK := methodsInterface.([]interface{})
if !methodsOK { if !methodsOK {
logrus.Fatal(addr, "transformer `methods` not of type []string\r\n") log.Fatal(addr, "transformer `methods` not of type []string\r\n")
} }
for _, strI := range methodsI { for _, strI := range methodsI {
str, strOK := strI.(string) str, strOK := strI.(string)
if !strOK { if !strOK {
logrus.Fatal(addr, "transformer `methods` not of type []string\r\n") log.Fatal(addr, "transformer `methods` not of type []string\r\n")
} }
methods = append(methods, str) methods = append(methods, str)
} }
@ -155,17 +151,17 @@ func (contractConfig *ContractConfig) PrepConfig() {
eventArgs := make([]string, 0) eventArgs := make([]string, 0)
eventArgsInterface, eventArgsOK := transformer["eventArgs"] eventArgsInterface, eventArgsOK := transformer["eventArgs"]
if !eventArgsOK { if !eventArgsOK {
logrus.Warnf("contract %s not configured with a list of event arguments to filter for, will not filter events for specific emitted values\r\n", addr) log.Warnf("contract %s not configured with a list of event arguments to filter for, will not filter events for specific emitted values\r\n", addr)
eventArgs = []string{} eventArgs = []string{}
} else { } else {
eventArgsI, eventArgsOK := eventArgsInterface.([]interface{}) eventArgsI, eventArgsOK := eventArgsInterface.([]interface{})
if !eventArgsOK { if !eventArgsOK {
logrus.Fatal(addr, "transformer `eventArgs` not of type []string\r\n") log.Fatal(addr, "transformer `eventArgs` not of type []string\r\n")
} }
for _, strI := range eventArgsI { for _, strI := range eventArgsI {
str, strOK := strI.(string) str, strOK := strI.(string)
if !strOK { if !strOK {
logrus.Fatal(addr, "transformer `eventArgs` not of type []string\r\n") log.Fatal(addr, "transformer `eventArgs` not of type []string\r\n")
} }
eventArgs = append(eventArgs, str) eventArgs = append(eventArgs, str)
} }
@ -176,17 +172,17 @@ func (contractConfig *ContractConfig) PrepConfig() {
methodArgs := make([]string, 0) methodArgs := make([]string, 0)
methodArgsInterface, methodArgsOK := transformer["methodArgs"] methodArgsInterface, methodArgsOK := transformer["methodArgs"]
if !methodArgsOK { if !methodArgsOK {
logrus.Warnf("contract %s not configured with a list of method argument values to poll with, will poll methods with all available arguments\r\n", addr) log.Warnf("contract %s not configured with a list of method argument values to poll with, will poll methods with all available arguments\r\n", addr)
methodArgs = []string{} methodArgs = []string{}
} else { } else {
methodArgsI, methodArgsOK := methodArgsInterface.([]interface{}) methodArgsI, methodArgsOK := methodArgsInterface.([]interface{})
if !methodArgsOK { if !methodArgsOK {
logrus.Fatal(addr, "transformer `methodArgs` not of type []string\r\n") log.Fatal(addr, "transformer `methodArgs` not of type []string\r\n")
} }
for _, strI := range methodArgsI { for _, strI := range methodArgsI {
str, strOK := strI.(string) str, strOK := strI.(string)
if !strOK { if !strOK {
logrus.Fatal(addr, "transformer `methodArgs` not of type []string\r\n") log.Fatal(addr, "transformer `methodArgs` not of type []string\r\n")
} }
methodArgs = append(methodArgs, str) methodArgs = append(methodArgs, str)
} }
@ -196,11 +192,11 @@ func (contractConfig *ContractConfig) PrepConfig() {
// Get and check startingBlock // Get and check startingBlock
startInterface, startOK := transformer["startingblock"] startInterface, startOK := transformer["startingblock"]
if !startOK { if !startOK {
logrus.Fatal(addr, "transformer config is missing `startingBlock` value\r\n") log.Fatal(addr, "transformer config is missing `startingBlock` value\r\n")
} }
start, startOK := startInterface.(int64) start, startOK := startInterface.(int64)
if !startOK { if !startOK {
logrus.Fatal(addr, "transformer `startingBlock` not of type int\r\n") log.Fatal(addr, "transformer `startingBlock` not of type int\r\n")
} }
contractConfig.StartingBlocks[strings.ToLower(addr)] = start contractConfig.StartingBlocks[strings.ToLower(addr)] = start
@ -208,13 +204,13 @@ func (contractConfig *ContractConfig) PrepConfig() {
var piping bool var piping bool
_, pipeOK := transformer["piping"] _, pipeOK := transformer["piping"]
if !pipeOK { if !pipeOK {
logrus.Warnf("contract %s does not have its `piping` set, by default piping is turned off\r\n", addr) log.Warnf("contract %s does not have its `piping` set, by default piping is turned off\r\n", addr)
piping = false piping = false
} else { } else {
pipingInterface := transformer["piping"] pipingInterface := transformer["piping"]
piping, pipeOK = pipingInterface.(bool) piping, pipeOK = pipingInterface.(bool)
if !pipeOK { if !pipeOK {
logrus.Fatal(addr, "transformer `piping` not of type bool\r\n") log.Fatal(addr, "transformer `piping` not of type bool\r\n")
} }
} }
contractConfig.Piping[strings.ToLower(addr)] = piping contractConfig.Piping[strings.ToLower(addr)] = piping