forked from cerc-io/ipld-eth-server
Backfill Pit.file log events
This commit is contained in:
@@ -17,7 +17,7 @@ package frob
|
||||
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
|
||||
var FrobConfig = shared.TransformerConfig{
|
||||
ContractAddresses: "0xff3f2400f1600f3f493a9a92704a29b96795af1a", //this is a temporary address deployed locally
|
||||
ContractAddress: "0xff3f2400f1600f3f493a9a92704a29b96795af1a", //this is a temporary address deployed locally
|
||||
ContractAbi: FrobABI,
|
||||
Topics: []string{FrobEventSignature},
|
||||
StartingBlockNumber: 0,
|
||||
|
||||
@@ -52,12 +52,12 @@ func (transformer FrobTransformer) Execute() error {
|
||||
}
|
||||
for _, header := range missingHeaders {
|
||||
topics := [][]common.Hash{{common.HexToHash(FrobEventSignature)}}
|
||||
matchingLogs, err := transformer.Fetcher.FetchLogs(FrobConfig.ContractAddresses, topics, header.BlockNumber)
|
||||
matchingLogs, err := transformer.Fetcher.FetchLogs(FrobConfig.ContractAddress, topics, header.BlockNumber)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, log := range matchingLogs {
|
||||
entity, err := transformer.Converter.ToEntity(FrobConfig.ContractAddresses, FrobConfig.ContractAbi, log)
|
||||
entity, err := transformer.Converter.ToEntity(FrobConfig.ContractAddress, FrobConfig.ContractAbi, log)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ var _ = Describe("Frob transformer", func() {
|
||||
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(fetcher.FetchedBlocks).To(Equal([]int64{1, 2}))
|
||||
Expect(fetcher.FetchedContractAddress).To(Equal(frob.FrobConfig.ContractAddresses))
|
||||
Expect(fetcher.FetchedContractAddress).To(Equal(frob.FrobConfig.ContractAddress))
|
||||
Expect(fetcher.FetchedTopics).To(Equal([][]common.Hash{{common.HexToHash(frob.FrobEventSignature)}}))
|
||||
})
|
||||
|
||||
@@ -110,7 +110,7 @@ var _ = Describe("Frob transformer", func() {
|
||||
err := transformer.Execute()
|
||||
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(converter.PassedContractAddress).To(Equal(frob.FrobConfig.ContractAddresses))
|
||||
Expect(converter.PassedContractAddress).To(Equal(frob.FrobConfig.ContractAddress))
|
||||
Expect(converter.PassedContractABI).To(Equal(frob.FrobConfig.ContractAbi))
|
||||
Expect(converter.PassedLog).To(Equal(test_data.EthFrobLog))
|
||||
Expect(converter.PassedEntity).To(Equal(test_data.FrobEntity))
|
||||
|
||||
Reference in New Issue
Block a user