Update watcher to use blockchain instead of contract data fetcher

This commit is contained in:
Matt Krump 2018-03-12 15:36:11 -05:00 committed by Matt K
parent 76dad443ec
commit a11fb709b2
4 changed files with 4 additions and 4 deletions

View File

@ -10,7 +10,7 @@ type Handler interface {
Execute() error 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 { func HexToInt64(byteString string) int64 {
intHash := common.HexToHash(byteString) intHash := common.HexToHash(byteString)

View File

@ -8,7 +8,7 @@ import (
type Watcher struct { type Watcher struct {
Handlers []Handler Handlers []Handler
DB postgres.DB DB postgres.DB
Blockchain core.ContractDataFetcher Blockchain core.Blockchain
} }
func (watcher *Watcher) AddHandlers(us []HandlerInitializer) { func (watcher *Watcher) AddHandlers(us []HandlerInitializer) {

View File

@ -23,7 +23,7 @@ func (mh *MockHandler) Execute() error {
return nil return nil
} }
func fakeHandlerInitializer(db *postgres.DB, blockchain core.ContractDataFetcher) shared.Handler { func fakeHandlerInitializer(db *postgres.DB, blockchain core.Blockchain) shared.Handler {
return &MockHandler{} return &MockHandler{}
} }

View File

@ -130,7 +130,7 @@ var _ = Describe("Parity Node Info", func() {
It("returns infura ID and client name for infura node", func() { It("returns infura ID and client name for infura node", func() {
mcc := MockContextCaller{core.INFURA} 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) n := node.MakeNode(cw)
Expect(n.ID).To(Equal("infura")) Expect(n.ID).To(Equal("infura"))
Expect(n.ClientName).To(Equal("infura")) Expect(n.ClientName).To(Equal("infura"))