forked from cerc-io/ipld-eth-server
Apply go formatting
This commit is contained in:
parent
a577811e0a
commit
70fcc22a00
@ -1,13 +1,19 @@
|
|||||||
package streamer_test
|
package streamer_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"io/ioutil"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestStreamer(t *testing.T) {
|
func TestStreamer(t *testing.T) {
|
||||||
RegisterFailHandler(Fail)
|
RegisterFailHandler(Fail)
|
||||||
RunSpecs(t, "Streamer Suite")
|
RunSpecs(t, "Streamer Suite")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var _ = BeforeSuite(func() {
|
||||||
|
logrus.SetOutput(ioutil.Discard)
|
||||||
|
})
|
||||||
|
@ -80,7 +80,7 @@ func (storageWatcher StorageWatcher) Execute(rows chan utils.StorageDiffRow, err
|
|||||||
|
|
||||||
func (storageWatcher StorageWatcher) getTransformer(contractAddress common.Address) (transformer.StorageTransformer, bool) {
|
func (storageWatcher StorageWatcher) getTransformer(contractAddress common.Address) (transformer.StorageTransformer, bool) {
|
||||||
if storageWatcher.diffSource == "csv" {
|
if storageWatcher.diffSource == "csv" {
|
||||||
storageTransformer, ok := storageWatcher.Transformers[contractAddress]
|
storageTransformer, ok := storageWatcher.Transformers[contractAddress]
|
||||||
return storageTransformer, ok
|
return storageTransformer, ok
|
||||||
} else if storageWatcher.diffSource == "geth" {
|
} else if storageWatcher.diffSource == "geth" {
|
||||||
logrus.Debug("number of transformers", len(storageWatcher.Transformers))
|
logrus.Debug("number of transformers", len(storageWatcher.Transformers))
|
||||||
@ -96,7 +96,6 @@ func (storageWatcher StorageWatcher) getTransformer(contractAddress common.Addre
|
|||||||
return nil, false
|
return nil, false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (storageWatcher StorageWatcher) processRow(row utils.StorageDiffRow) {
|
func (storageWatcher StorageWatcher) processRow(row utils.StorageDiffRow) {
|
||||||
storageTransformer, ok := storageWatcher.getTransformer(row.Contract)
|
storageTransformer, ok := storageWatcher.getTransformer(row.Contract)
|
||||||
if !ok {
|
if !ok {
|
||||||
|
@ -52,8 +52,8 @@ var _ = Describe("Storage Watcher", func() {
|
|||||||
mockFetcher *mocks.MockStorageFetcher
|
mockFetcher *mocks.MockStorageFetcher
|
||||||
mockQueue *mocks.MockStorageQueue
|
mockQueue *mocks.MockStorageQueue
|
||||||
mockTransformer *mocks.MockStorageTransformer
|
mockTransformer *mocks.MockStorageTransformer
|
||||||
csvRow utils.StorageDiffRow
|
csvRow utils.StorageDiffRow
|
||||||
gethRow utils.StorageDiffRow
|
gethRow utils.StorageDiffRow
|
||||||
rows chan utils.StorageDiffRow
|
rows chan utils.StorageDiffRow
|
||||||
storageWatcher watcher.StorageWatcher
|
storageWatcher watcher.StorageWatcher
|
||||||
)
|
)
|
||||||
@ -291,7 +291,7 @@ var _ = Describe("Storage Watcher", func() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
Describe("where diff source is geth RPC pub sub", func() {
|
Describe("where diff source is geth RPC pub sub", func() {
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
mockQueue.RowsToReturn = []utils.StorageDiffRow{gethRow}
|
mockQueue.RowsToReturn = []utils.StorageDiffRow{gethRow}
|
||||||
storageWatcher = watcher.NewStorageWatcher(mockFetcher, test_config.NewTestDB(test_config.NewTestNode()))
|
storageWatcher = watcher.NewStorageWatcher(mockFetcher, test_config.NewTestDB(test_config.NewTestNode()))
|
||||||
|
Loading…
Reference in New Issue
Block a user