forked from cerc-io/ipld-eth-server
use logrus for logging
This commit is contained in:
@@ -3,8 +3,8 @@ package postgres_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"errors"
|
||||
"log"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/jmoiron/sqlx"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package testing
|
||||
|
||||
import (
|
||||
"log"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/pkg/core"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/geth"
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"testing"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package history
|
||||
|
||||
import (
|
||||
"log"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/pkg/core"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/datastore"
|
||||
@@ -11,7 +11,6 @@ import (
|
||||
func PopulateMissingHeaders(blockchain core.BlockChain, headerRepository datastore.HeaderRepository, startingBlockNumber int64) (int, error) {
|
||||
lastBlock := blockchain.LastBlock().Int64()
|
||||
blockRange := headerRepository.MissingBlockNumbers(startingBlockNumber, lastBlock, blockchain.Node().ID)
|
||||
log.SetPrefix("")
|
||||
log.Printf("Backfilling %d blocks\n\n", len(blockRange))
|
||||
_, err := RetrieveAndUpdateHeaders(blockchain, headerRepository, blockRange)
|
||||
if err != nil {
|
||||
|
||||
@@ -19,8 +19,8 @@ import (
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
)
|
||||
|
||||
func TestBite(t *testing.T) {
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
package chop_lump_test
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"testing"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
package flip_test
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"testing"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
package pit_vow_test
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"testing"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
)
|
||||
|
||||
func TestFlipDeal(t *testing.T) {
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
)
|
||||
|
||||
func TestDent(t *testing.T) {
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
package drip_drip_test
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"testing"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
package ilk_test
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"testing"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
package repo_test
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"testing"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
package vow_test
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"testing"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
)
|
||||
|
||||
func TestFactories(t *testing.T) {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
package factories
|
||||
|
||||
import (
|
||||
"log"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
|
||||
@@ -41,7 +41,7 @@ func (transformer LogNoteTransformer) Execute() error {
|
||||
transformerName := transformer.Config.TransformerName
|
||||
missingHeaders, err := transformer.Repository.MissingHeaders(transformer.Config.StartingBlockNumber, transformer.Config.EndingBlockNumber)
|
||||
if err != nil {
|
||||
log.Printf("Error fetching mising headers in %v transformer: %v \n", transformerName, err)
|
||||
log.Printf("Error fetching mising headers in %v transformer: %v", transformerName, err)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ func (transformer LogNoteTransformer) Execute() error {
|
||||
// (Double-array structure required for go-ethereum FilterQuery)
|
||||
var topic = [][]common.Hash{{common.HexToHash(transformer.Config.Topic)}}
|
||||
|
||||
log.Printf("Fetching %v event logs for %d headers \n", transformerName, len(missingHeaders))
|
||||
log.Printf("Fetching %v event logs for %d headers", transformerName, len(missingHeaders))
|
||||
for _, header := range missingHeaders {
|
||||
// Fetch the missing logs for a given header
|
||||
matchingLogs, err := transformer.Fetcher.FetchLogs(transformer.Config.ContractAddresses, topic, header)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
package factories
|
||||
|
||||
import (
|
||||
"log"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
package flap_kick_test
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"testing"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
package flip_kick
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"testing"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
|
||||
@@ -18,6 +18,7 @@ import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/ethereum/go-ethereum/accounts/abi/bind"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
@@ -30,6 +31,7 @@ type FrobConverter struct{}
|
||||
|
||||
func (FrobConverter) ToEntities(contractAbi string, ethLogs []types.Log) ([]interface{}, error) {
|
||||
var entities []interface{}
|
||||
log.Info("blah")
|
||||
for _, ethLog := range ethLogs {
|
||||
entity := FrobEntity{}
|
||||
address := ethLog.Address
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
package frob_test
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"testing"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package integration_tests
|
||||
|
||||
import (
|
||||
"log"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"testing"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
|
||||
@@ -33,13 +33,13 @@ var _ = Describe("VowFlog LogNoteTransformer", func() {
|
||||
|
||||
rpcClient, ethClient, err := getClients(ipc)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
blockchain, err := getBlockChain(rpcClient, ethClient)
|
||||
blockChain, err := getBlockChain(rpcClient, ethClient)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
db := test_config.NewTestDB(blockchain.Node())
|
||||
db := test_config.NewTestDB(blockChain.Node())
|
||||
test_config.CleanTestDB(db)
|
||||
|
||||
err = persistHeader(db, blockNumber, blockchain)
|
||||
err = persistHeader(db, blockNumber, blockChain)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(1).To(Equal(1))
|
||||
|
||||
@@ -49,7 +49,7 @@ var _ = Describe("VowFlog LogNoteTransformer", func() {
|
||||
Converter: &vow_flog.VowFlogConverter{},
|
||||
Repository: &vow_flog.VowFlogRepository{},
|
||||
}
|
||||
transformer := initializer.NewLogNoteTransformer(db, blockchain)
|
||||
transformer := initializer.NewLogNoteTransformer(db, blockChain)
|
||||
err = transformer.Execute()
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
package debt_ceiling_test
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"testing"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
package ilk_test
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"testing"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
package price_feeds_test
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"testing"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package tend_test
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"testing"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package vat_flux_test
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"testing"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package vat_fold_test
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"testing"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package vat_grab_test
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"testing"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package vat_heal_test
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"testing"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
package vat_init_test
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"testing"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
package vat_move_test
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"testing"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
|
||||
@@ -19,8 +19,8 @@ import (
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
)
|
||||
|
||||
func TestVatSlip(t *testing.T) {
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
)
|
||||
|
||||
func TestVatToll(t *testing.T) {
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
)
|
||||
|
||||
func TestVatTune(t *testing.T) {
|
||||
|
||||
@@ -19,8 +19,8 @@ import (
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
)
|
||||
|
||||
func TestVowFlog(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user