From a11fb709b2a90677f0811b98d151ed6e3adeb88d Mon Sep 17 00:00:00 2001 From: Matt Krump Date: Mon, 12 Mar 2018 15:36:11 -0500 Subject: [PATCH] Update watcher to use blockchain instead of contract data fetcher --- libraries/shared/handler_interface.go | 2 +- libraries/shared/watcher.go | 2 +- libraries/shared/watcher_test.go | 2 +- pkg/geth/node/node_test.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/shared/handler_interface.go b/libraries/shared/handler_interface.go index 951b864e..4382fba1 100644 --- a/libraries/shared/handler_interface.go +++ b/libraries/shared/handler_interface.go @@ -10,7 +10,7 @@ type Handler interface { Execute() error } -type HandlerInitializer func(db *postgres.DB, blockchain core.ContractDataFetcher) Handler +type HandlerInitializer func(db *postgres.DB, blockchain core.Blockchain) Handler func HexToInt64(byteString string) int64 { intHash := common.HexToHash(byteString) diff --git a/libraries/shared/watcher.go b/libraries/shared/watcher.go index 14aebb81..2a18afec 100644 --- a/libraries/shared/watcher.go +++ b/libraries/shared/watcher.go @@ -8,7 +8,7 @@ import ( type Watcher struct { Handlers []Handler DB postgres.DB - Blockchain core.ContractDataFetcher + Blockchain core.Blockchain } func (watcher *Watcher) AddHandlers(us []HandlerInitializer) { diff --git a/libraries/shared/watcher_test.go b/libraries/shared/watcher_test.go index ada33e70..2b79085c 100644 --- a/libraries/shared/watcher_test.go +++ b/libraries/shared/watcher_test.go @@ -23,7 +23,7 @@ func (mh *MockHandler) Execute() error { return nil } -func fakeHandlerInitializer(db *postgres.DB, blockchain core.ContractDataFetcher) shared.Handler { +func fakeHandlerInitializer(db *postgres.DB, blockchain core.Blockchain) shared.Handler { return &MockHandler{} } diff --git a/pkg/geth/node/node_test.go b/pkg/geth/node/node_test.go index 4cc9a71f..5fe9d593 100644 --- a/pkg/geth/node/node_test.go +++ b/pkg/geth/node/node_test.go @@ -130,7 +130,7 @@ var _ = Describe("Parity Node Info", func() { It("returns infura ID and client name for infura node", func() { mcc := MockContextCaller{core.INFURA} - cw := node.ClientWrapper{mcc, "https://mainnet.infura.io/123"} + cw := node.ClientWrapper{ContextCaller: mcc, IPCPath: "https://mainnet.infura.io/123"} n := node.MakeNode(cw) Expect(n.ID).To(Equal("infura")) Expect(n.ClientName).To(Equal("infura"))