Finish watcher and watcher tests (+fmt)
This commit is contained in:
@@ -19,8 +19,6 @@ import (
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
)
|
||||
|
||||
// TODO Add unit tests for LogChunker
|
||||
|
||||
type LogChunker struct {
|
||||
AddressToNames map[string][]string
|
||||
NameToTopic0 map[string]common.Hash
|
||||
@@ -40,7 +38,7 @@ func NewLogChunker(transformerConfigs []TransformerConfig) LogChunker {
|
||||
|
||||
return LogChunker{
|
||||
AddressToNames: addressToNames,
|
||||
NameToTopic0: nameToTopic0,
|
||||
NameToTopic0: nameToTopic0,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ var _ = Describe("Log chunker", func() {
|
||||
logs := []types.Log{log1, log2, log3, log4, log5}
|
||||
chunks := chunker.ChunkLogs(logs)
|
||||
|
||||
Expect(chunks["TransformerA"]).To(And(ContainElement(log1),ContainElement(log4)))
|
||||
Expect(chunks["TransformerA"]).To(And(ContainElement(log1), ContainElement(log4)))
|
||||
Expect(chunks["TransformerB"]).To(BeEmpty())
|
||||
Expect(chunks["TransformerC"]).To(ContainElement(log5))
|
||||
})
|
||||
@@ -119,4 +119,4 @@ var (
|
||||
common.HexToHash("0xLogTopic5"),
|
||||
},
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
@@ -26,14 +26,7 @@ import (
|
||||
)
|
||||
|
||||
var _ = Describe("Fetcher", func() {
|
||||
Describe("Iinitialisation", func() {
|
||||
It("creates correct lookup maps", func() {
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
Describe("FetchLogs", func() {
|
||||
// TODO Add tests for aggregate fetching
|
||||
It("fetches logs based on the given query", func() {
|
||||
blockChain := fakes.NewMockBlockChain()
|
||||
fetcher := shared.NewFetcher(blockChain)
|
||||
|
||||
Reference in New Issue
Block a user