forked from cerc-io/ipld-eth-server
Flop deal (#39)
*Refactor deal transformer to take in several contract addresses * Add flop address to deal transformer
This commit is contained in:
@@ -19,7 +19,7 @@ import (
|
||||
)
|
||||
|
||||
var VatInitConfig = shared.TransformerConfig{
|
||||
ContractAddress: shared.VatContractAddress,
|
||||
ContractAddresses: []string{shared.VatContractAddress},
|
||||
ContractAbi: shared.VatABI,
|
||||
Topics: []string{shared.VatInitSignature},
|
||||
StartingBlockNumber: 0,
|
||||
|
||||
@@ -55,7 +55,7 @@ func (transformer VatInitTransformer) Execute() error {
|
||||
log.Printf("Fetching vat init event logs for %d headers \n", len(missingHeaders))
|
||||
for _, header := range missingHeaders {
|
||||
topics := [][]common.Hash{{common.HexToHash(shared.VatInitSignature)}}
|
||||
matchingLogs, err := transformer.Fetcher.FetchLogs(VatInitConfig.ContractAddress, topics, header.BlockNumber)
|
||||
matchingLogs, err := transformer.Fetcher.FetchLogs(VatInitConfig.ContractAddresses, topics, header.BlockNumber)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ var _ = Describe("Vat init transformer", func() {
|
||||
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(fetcher.FetchedBlocks).To(Equal([]int64{1, 2}))
|
||||
Expect(fetcher.FetchedContractAddress).To(Equal(vat_init.VatInitConfig.ContractAddress))
|
||||
Expect(fetcher.FetchedContractAddresses).To(Equal([][]string{vat_init.VatInitConfig.ContractAddresses, vat_init.VatInitConfig.ContractAddresses}))
|
||||
Expect(fetcher.FetchedTopics).To(Equal([][]common.Hash{{common.HexToHash(shared.VatInitSignature)}}))
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user