forked from cerc-io/ipld-eth-server
Extract constants package
- Reduce clutter in the shared package
This commit is contained in:
parent
8c5192f82f
commit
8c168ed332
@ -24,6 +24,7 @@ import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers"
|
||||
shared2 "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
// continuousLogSyncCmd represents the continuousLogSync command
|
||||
@ -86,35 +87,35 @@ func getTransformerInititalizers(transformerNames []string) []shared2.Transforme
|
||||
func buildTransformerInitializerMap() map[string]shared2.TransformerInitializer {
|
||||
transformerInitializerMap := make(map[string]shared2.TransformerInitializer)
|
||||
|
||||
transformerInitializerMap[shared2.BiteLabel] = transformers.BiteTransformerInitializer
|
||||
transformerInitializerMap[shared2.CatFileChopLumpLabel] = transformers.CatFileChopLumpTransformerInitializer
|
||||
transformerInitializerMap[shared2.CatFileFlipLabel] = transformers.CatFileFlipTransformerInitializer
|
||||
transformerInitializerMap[shared2.CatFilePitVowLabel] = transformers.CatFilePitVowTransformerInitializer
|
||||
transformerInitializerMap[shared2.DealLabel] = transformers.DealTransformerInitializer
|
||||
transformerInitializerMap[shared2.DentLabel] = transformers.DentTransformerInitializer
|
||||
transformerInitializerMap[shared2.DripDripLabel] = transformers.DripDripTransformerInitializer
|
||||
transformerInitializerMap[shared2.DripFileIlkLabel] = transformers.DripFileIlkTransformerInitializer
|
||||
transformerInitializerMap[shared2.DripFileRepoLabel] = transformers.DripFileRepoTransformerInitializer
|
||||
transformerInitializerMap[shared2.DripFileVowLabel] = transformers.DripFileVowTransfromerInitializer
|
||||
transformerInitializerMap[shared2.FlapKickLabel] = transformers.FlapKickTransformerInitializer
|
||||
transformerInitializerMap[shared2.FlipKickLabel] = transformers.FlipKickTransformerInitializer
|
||||
transformerInitializerMap[shared2.VowFlogLabel] = transformers.FlogTransformerInitializer
|
||||
transformerInitializerMap[shared2.FlopKickLabel] = transformers.FlopKickTransformerInitializer
|
||||
transformerInitializerMap[shared2.FrobLabel] = transformers.FrobTransformerInitializer
|
||||
transformerInitializerMap[shared2.PitFileDebtCeilingLabel] = transformers.PitFileDebtCeilingTransformerInitializer
|
||||
transformerInitializerMap[shared2.PitFileIlkLabel] = transformers.PitFileIlkTransformerInitializer
|
||||
transformerInitializerMap[shared2.PitFileStabilityFeeLabel] = transformers.PitFileStabilityFeeTransformerInitializer
|
||||
transformerInitializerMap[shared2.PriceFeedLabel] = transformers.PriceFeedTransformerInitializer
|
||||
transformerInitializerMap[shared2.TendLabel] = transformers.TendTransformerInitializer
|
||||
transformerInitializerMap[shared2.VatGrabLabel] = transformers.VatGrabTransformerInitializer
|
||||
transformerInitializerMap[shared2.VatInitLabel] = transformers.VatInitTransformerInitializer
|
||||
transformerInitializerMap[shared2.VatMoveLabel] = transformers.VatMoveTransformerInitializer
|
||||
transformerInitializerMap[shared2.VatHealLabel] = transformers.VatHealTransformerInitializer
|
||||
transformerInitializerMap[shared2.VatFoldLabel] = transformers.VatFoldTransformerInitializer
|
||||
transformerInitializerMap[shared2.VatSlipLabel] = transformers.VatSlipTransformerInitializer
|
||||
transformerInitializerMap[shared2.VatTollLabel] = transformers.VatTollTransformerInitializer
|
||||
transformerInitializerMap[shared2.VatTuneLabel] = transformers.VatTuneTransformerInitializer
|
||||
transformerInitializerMap[shared2.VatFluxLabel] = transformers.VatFluxTransformerInitializer
|
||||
transformerInitializerMap[constants.BiteLabel] = transformers.BiteTransformerInitializer
|
||||
transformerInitializerMap[constants.CatFileChopLumpLabel] = transformers.CatFileChopLumpTransformerInitializer
|
||||
transformerInitializerMap[constants.CatFileFlipLabel] = transformers.CatFileFlipTransformerInitializer
|
||||
transformerInitializerMap[constants.CatFilePitVowLabel] = transformers.CatFilePitVowTransformerInitializer
|
||||
transformerInitializerMap[constants.DealLabel] = transformers.DealTransformerInitializer
|
||||
transformerInitializerMap[constants.DentLabel] = transformers.DentTransformerInitializer
|
||||
transformerInitializerMap[constants.DripDripLabel] = transformers.DripDripTransformerInitializer
|
||||
transformerInitializerMap[constants.DripFileIlkLabel] = transformers.DripFileIlkTransformerInitializer
|
||||
transformerInitializerMap[constants.DripFileRepoLabel] = transformers.DripFileRepoTransformerInitializer
|
||||
transformerInitializerMap[constants.DripFileVowLabel] = transformers.DripFileVowTransfromerInitializer
|
||||
transformerInitializerMap[constants.FlapKickLabel] = transformers.FlapKickTransformerInitializer
|
||||
transformerInitializerMap[constants.FlipKickLabel] = transformers.FlipKickTransformerInitializer
|
||||
transformerInitializerMap[constants.VowFlogLabel] = transformers.FlogTransformerInitializer
|
||||
transformerInitializerMap[constants.FlopKickLabel] = transformers.FlopKickTransformerInitializer
|
||||
transformerInitializerMap[constants.FrobLabel] = transformers.FrobTransformerInitializer
|
||||
transformerInitializerMap[constants.PitFileDebtCeilingLabel] = transformers.PitFileDebtCeilingTransformerInitializer
|
||||
transformerInitializerMap[constants.PitFileIlkLabel] = transformers.PitFileIlkTransformerInitializer
|
||||
transformerInitializerMap[constants.PitFileStabilityFeeLabel] = transformers.PitFileStabilityFeeTransformerInitializer
|
||||
transformerInitializerMap[constants.PriceFeedLabel] = transformers.PriceFeedTransformerInitializer
|
||||
transformerInitializerMap[constants.TendLabel] = transformers.TendTransformerInitializer
|
||||
transformerInitializerMap[constants.VatGrabLabel] = transformers.VatGrabTransformerInitializer
|
||||
transformerInitializerMap[constants.VatInitLabel] = transformers.VatInitTransformerInitializer
|
||||
transformerInitializerMap[constants.VatMoveLabel] = transformers.VatMoveTransformerInitializer
|
||||
transformerInitializerMap[constants.VatHealLabel] = transformers.VatHealTransformerInitializer
|
||||
transformerInitializerMap[constants.VatFoldLabel] = transformers.VatFoldTransformerInitializer
|
||||
transformerInitializerMap[constants.VatSlipLabel] = transformers.VatSlipTransformerInitializer
|
||||
transformerInitializerMap[constants.VatTollLabel] = transformers.VatTollTransformerInitializer
|
||||
transformerInitializerMap[constants.VatTuneLabel] = transformers.VatTuneTransformerInitializer
|
||||
transformerInitializerMap[constants.VatFluxLabel] = transformers.VatFluxTransformerInitializer
|
||||
|
||||
return transformerInitializerMap
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ package cmd
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"log"
|
||||
)
|
||||
|
||||
@ -33,33 +33,33 @@ vulcanizedb getSignatures`,
|
||||
|
||||
func getSignatures() {
|
||||
signatures := make(map[string]string)
|
||||
signatures["BiteSignature"] = shared.BiteSignature
|
||||
signatures["DealSignature"] = shared.DealSignature
|
||||
signatures["CatFileChopLumpSignature"] = shared.CatFileChopLumpSignature
|
||||
signatures["CatFileFlipSignature"] = shared.CatFileFlipSignature
|
||||
signatures["CatFilePitVowSignature"] = shared.CatFilePitVowSignature
|
||||
signatures["DentFunctionSignature"] = shared.DentFunctionSignature
|
||||
signatures["DripDripSignature"] = shared.DripDripSignature
|
||||
signatures["DripFileIlkSignature"] = shared.DripFileIlkSignature
|
||||
signatures["DripFileRepoSignature"] = shared.DripFileRepoSignature
|
||||
signatures["DripFileVowSignature"] = shared.DripFileVowSignature
|
||||
signatures["FlipKickSignature"] = shared.FlipKickSignature
|
||||
signatures["FlopKickSignature"] = shared.FlopKickSignature
|
||||
signatures["FrobSignature"] = shared.FrobSignature
|
||||
signatures["LogValueSignature"] = shared.LogValueSignature
|
||||
signatures["PitFileDebtCeilingSignature"] = shared.PitFileDebtCeilingSignature
|
||||
signatures["PitFileIlkSignature"] = shared.PitFileIlkSignature
|
||||
signatures["PitFileStabilityFeeSignature"] = shared.PitFileStabilityFeeSignature
|
||||
signatures["TendFunctionSignature"] = shared.TendFunctionSignature
|
||||
signatures["VatHealSignature"] = shared.VatHealSignature
|
||||
signatures["VatGrabSignature"] = shared.VatGrabSignature
|
||||
signatures["VatInitSignature"] = shared.VatInitSignature
|
||||
signatures["VatFluxSignature"] = shared.VatFluxSignature
|
||||
signatures["VatFoldSignature"] = shared.VatFoldSignature
|
||||
signatures["VatMoveSignature"] = shared.VatMoveSignature
|
||||
signatures["VatSlipSignature"] = shared.VatSlipSignature
|
||||
signatures["VatTollSignature"] = shared.VatTollSignature
|
||||
signatures["VatTuneSignature"] = shared.VatTuneSignature
|
||||
signatures["BiteSignature"] = constants.BiteSignature
|
||||
signatures["DealSignature"] = constants.DealSignature
|
||||
signatures["CatFileChopLumpSignature"] = constants.CatFileChopLumpSignature
|
||||
signatures["CatFileFlipSignature"] = constants.CatFileFlipSignature
|
||||
signatures["CatFilePitVowSignature"] = constants.CatFilePitVowSignature
|
||||
signatures["DentFunctionSignature"] = constants.DentFunctionSignature
|
||||
signatures["DripDripSignature"] = constants.DripDripSignature
|
||||
signatures["DripFileIlkSignature"] = constants.DripFileIlkSignature
|
||||
signatures["DripFileRepoSignature"] = constants.DripFileRepoSignature
|
||||
signatures["DripFileVowSignature"] = constants.DripFileVowSignature
|
||||
signatures["FlipKickSignature"] = constants.FlipKickSignature
|
||||
signatures["FlopKickSignature"] = constants.FlopKickSignature
|
||||
signatures["FrobSignature"] = constants.FrobSignature
|
||||
signatures["LogValueSignature"] = constants.LogValueSignature
|
||||
signatures["PitFileDebtCeilingSignature"] = constants.PitFileDebtCeilingSignature
|
||||
signatures["PitFileIlkSignature"] = constants.PitFileIlkSignature
|
||||
signatures["PitFileStabilityFeeSignature"] = constants.PitFileStabilityFeeSignature
|
||||
signatures["TendFunctionSignature"] = constants.TendFunctionSignature
|
||||
signatures["VatHealSignature"] = constants.VatHealSignature
|
||||
signatures["VatGrabSignature"] = constants.VatGrabSignature
|
||||
signatures["VatInitSignature"] = constants.VatInitSignature
|
||||
signatures["VatFluxSignature"] = constants.VatFluxSignature
|
||||
signatures["VatFoldSignature"] = constants.VatFoldSignature
|
||||
signatures["VatMoveSignature"] = constants.VatMoveSignature
|
||||
signatures["VatSlipSignature"] = constants.VatSlipSignature
|
||||
signatures["VatTollSignature"] = constants.VatTollSignature
|
||||
signatures["VatTuneSignature"] = constants.VatTuneSignature
|
||||
|
||||
for name, sig := range signatures {
|
||||
log.Println(name, ": ", sig)
|
||||
|
@ -18,13 +18,14 @@ package bite
|
||||
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var BiteConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.BiteLabel,
|
||||
ContractAddresses: []string{shared.CatContractAddress},
|
||||
ContractAbi: shared.CatABI,
|
||||
Topic: shared.BiteSignature,
|
||||
TransformerName: constants.BiteLabel,
|
||||
ContractAddresses: []string{constants.CatContractAddress},
|
||||
ContractAbi: constants.CatABI,
|
||||
Topic: constants.BiteSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -18,13 +18,14 @@ package bite_test
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/bite"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/test_data"
|
||||
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/bite"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/test_data"
|
||||
)
|
||||
|
||||
var _ = Describe("Bite Converter", func() {
|
||||
@ -32,7 +33,7 @@ var _ = Describe("Bite Converter", func() {
|
||||
|
||||
Describe("ToEntity", func() {
|
||||
It("converts an eth log to a bite entity", func() {
|
||||
entities, err := converter.ToEntities(shared.CatABI, []types.Log{test_data.EthBiteLog})
|
||||
entities, err := converter.ToEntities(constants.CatABI, []types.Log{test_data.EthBiteLog})
|
||||
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(len(entities)).To(Equal(1))
|
||||
|
@ -14,13 +14,16 @@
|
||||
|
||||
package chop_lump
|
||||
|
||||
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var CatFileChopLumpConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.CatFileChopLumpLabel,
|
||||
ContractAddresses: []string{shared.CatContractAddress},
|
||||
ContractAbi: shared.CatABI,
|
||||
Topic: shared.CatFileChopLumpSignature,
|
||||
TransformerName: constants.CatFileChopLumpLabel,
|
||||
ContractAddresses: []string{constants.CatContractAddress},
|
||||
ContractAbi: constants.CatABI,
|
||||
Topic: constants.CatFileChopLumpSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"math/big"
|
||||
)
|
||||
|
||||
@ -34,7 +34,7 @@ func (CatFileChopLumpConverter) ToModels(ethLogs []types.Log) ([]interface{}, er
|
||||
}
|
||||
ilk := string(bytes.Trim(ethLog.Topics[2].Bytes(), "\x00"))
|
||||
what := string(bytes.Trim(ethLog.Topics[3].Bytes(), "\x00"))
|
||||
dataBytes := ethLog.Data[len(ethLog.Data)-shared.DataItemLength:]
|
||||
dataBytes := ethLog.Data[len(ethLog.Data)-constants.DataItemLength:]
|
||||
data := big.NewInt(0).SetBytes(dataBytes).String()
|
||||
|
||||
raw, err := json.Marshal(ethLog)
|
||||
@ -58,7 +58,7 @@ func verifyLog(log types.Log) error {
|
||||
if len(log.Topics) < 4 {
|
||||
return errors.New("log missing topics")
|
||||
}
|
||||
if len(log.Data) < shared.DataItemLength {
|
||||
if len(log.Data) < constants.DataItemLength {
|
||||
return errors.New("log missing data")
|
||||
}
|
||||
return nil
|
||||
|
@ -14,13 +14,16 @@
|
||||
|
||||
package flip
|
||||
|
||||
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var CatFileFlipConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.CatFileFlipLabel,
|
||||
ContractAddresses: []string{shared.CatContractAddress},
|
||||
ContractAbi: shared.CatABI,
|
||||
Topic: shared.CatFileFlipSignature,
|
||||
TransformerName: constants.CatFileFlipLabel,
|
||||
ContractAddresses: []string{constants.CatContractAddress},
|
||||
ContractAbi: constants.CatABI,
|
||||
Topic: constants.CatFileFlipSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ import (
|
||||
"errors"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
type CatFileFlipConverter struct{}
|
||||
@ -34,7 +34,7 @@ func (CatFileFlipConverter) ToModels(ethLogs []types.Log) ([]interface{}, error)
|
||||
}
|
||||
ilk := string(bytes.Trim(ethLog.Topics[2].Bytes(), "\x00"))
|
||||
what := string(bytes.Trim(ethLog.Topics[3].Bytes(), "\x00"))
|
||||
flipBytes := ethLog.Data[len(ethLog.Data)-shared.DataItemLength:]
|
||||
flipBytes := ethLog.Data[len(ethLog.Data)-constants.DataItemLength:]
|
||||
flip := common.BytesToAddress(flipBytes).String()
|
||||
|
||||
raw, err := json.Marshal(ethLog)
|
||||
@ -58,7 +58,7 @@ func verifyLog(log types.Log) error {
|
||||
if len(log.Topics) < 4 {
|
||||
return errors.New("log missing topics")
|
||||
}
|
||||
if len(log.Data) < shared.DataItemLength {
|
||||
if len(log.Data) < constants.DataItemLength {
|
||||
return errors.New("log missing data")
|
||||
}
|
||||
return nil
|
||||
|
@ -14,13 +14,16 @@
|
||||
|
||||
package pit_vow
|
||||
|
||||
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var CatFilePitVowConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.CatFilePitVowLabel,
|
||||
ContractAddresses: []string{shared.CatContractAddress},
|
||||
ContractAbi: shared.CatABI,
|
||||
Topic: shared.CatFilePitVowSignature,
|
||||
TransformerName: constants.CatFilePitVowLabel,
|
||||
ContractAddresses: []string{constants.CatContractAddress},
|
||||
ContractAbi: constants.CatABI,
|
||||
Topic: constants.CatFilePitVowSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ import (
|
||||
"errors"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
type CatFilePitVowConverter struct{}
|
||||
@ -57,7 +57,7 @@ func verifyLog(log types.Log) error {
|
||||
if len(log.Topics) < 4 {
|
||||
return errors.New("log missing topics")
|
||||
}
|
||||
if len(log.Data) < shared.DataItemLength {
|
||||
if len(log.Data) < constants.DataItemLength {
|
||||
return errors.New("log missing data")
|
||||
}
|
||||
return nil
|
||||
|
@ -14,13 +14,16 @@
|
||||
|
||||
package deal
|
||||
|
||||
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var DealConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.DealLabel,
|
||||
ContractAddresses: []string{shared.FlapperContractAddress, shared.FlipperContractAddress, shared.FlopperContractAddress},
|
||||
ContractAbi: shared.FlipperABI,
|
||||
Topic: shared.DealSignature,
|
||||
TransformerName: constants.DealLabel,
|
||||
ContractAddresses: []string{constants.FlapperContractAddress, constants.FlipperContractAddress, constants.FlopperContractAddress},
|
||||
ContractAbi: constants.FlipperABI,
|
||||
Topic: constants.DealSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -14,13 +14,16 @@
|
||||
|
||||
package dent
|
||||
|
||||
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var DentConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.DentLabel,
|
||||
ContractAddresses: []string{shared.FlipperContractAddress, shared.FlopperContractAddress},
|
||||
ContractAbi: shared.FlipperABI,
|
||||
Topic: shared.DentFunctionSignature,
|
||||
TransformerName: constants.DentLabel,
|
||||
ContractAddresses: []string{constants.FlipperContractAddress, constants.FlopperContractAddress},
|
||||
ContractAbi: constants.FlipperABI,
|
||||
Topic: constants.DentFunctionSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -14,13 +14,16 @@
|
||||
|
||||
package drip_drip
|
||||
|
||||
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var DripDripConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.DripDripLabel,
|
||||
ContractAddresses: []string{shared.DripContractAddress},
|
||||
ContractAbi: shared.DripABI,
|
||||
Topic: shared.DripDripSignature,
|
||||
TransformerName: constants.DripDripLabel,
|
||||
ContractAddresses: []string{constants.DripContractAddress},
|
||||
ContractAbi: constants.DripABI,
|
||||
Topic: constants.DripDripSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -14,13 +14,16 @@
|
||||
|
||||
package ilk
|
||||
|
||||
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var DripFileIlkConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.DripFileIlkLabel,
|
||||
ContractAddresses: []string{shared.DripContractAddress},
|
||||
ContractAbi: shared.DripABI,
|
||||
Topic: shared.DripFileIlkSignature,
|
||||
TransformerName: constants.DripFileIlkLabel,
|
||||
ContractAddresses: []string{constants.DripContractAddress},
|
||||
ContractAbi: constants.DripABI,
|
||||
Topic: constants.DripFileIlkSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -17,11 +17,12 @@ package ilk
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"math/big"
|
||||
|
||||
"errors"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
type DripFileIlkConverter struct{}
|
||||
@ -36,7 +37,7 @@ func (DripFileIlkConverter) ToModels(ethLogs []types.Log) ([]interface{}, error)
|
||||
|
||||
ilk := string(bytes.Trim(ethLog.Topics[2].Bytes(), "\x00"))
|
||||
vow := string(bytes.Trim(ethLog.Topics[3].Bytes(), "\x00"))
|
||||
taxBytes := ethLog.Data[len(ethLog.Data)-shared.DataItemLength:]
|
||||
taxBytes := ethLog.Data[len(ethLog.Data)-constants.DataItemLength:]
|
||||
tax := big.NewInt(0).SetBytes(taxBytes).String()
|
||||
raw, err := json.Marshal(ethLog)
|
||||
if err != nil {
|
||||
@ -60,7 +61,7 @@ func verifyLog(log types.Log) error {
|
||||
if len(log.Topics) < 4 {
|
||||
return errors.New("log missing topics")
|
||||
}
|
||||
if len(log.Data) < shared.DataItemLength {
|
||||
if len(log.Data) < constants.DataItemLength {
|
||||
return errors.New("log missing data")
|
||||
}
|
||||
return nil
|
||||
|
@ -14,13 +14,16 @@
|
||||
|
||||
package repo
|
||||
|
||||
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var DripFileRepoConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.DripFileRepoLabel,
|
||||
ContractAddresses: []string{shared.DripContractAddress},
|
||||
ContractAbi: shared.DripABI,
|
||||
Topic: shared.DripFileRepoSignature,
|
||||
TransformerName: constants.DripFileRepoLabel,
|
||||
ContractAddresses: []string{constants.DripContractAddress},
|
||||
ContractAbi: constants.DripABI,
|
||||
Topic: constants.DripFileRepoSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -14,13 +14,16 @@
|
||||
|
||||
package vow
|
||||
|
||||
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var DripFileVowConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.DripFileVowLabel,
|
||||
ContractAddresses: []string{shared.DripContractAddress},
|
||||
ContractAbi: shared.DripABI,
|
||||
Topic: shared.DripFileVowSignature,
|
||||
TransformerName: constants.DripFileVowLabel,
|
||||
ContractAddresses: []string{constants.DripContractAddress},
|
||||
ContractAbi: constants.DripABI,
|
||||
Topic: constants.DripFileVowSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -14,13 +14,16 @@
|
||||
|
||||
package flap_kick
|
||||
|
||||
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var FlapKickConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.FlapKickLabel,
|
||||
ContractAddresses: []string{shared.FlapperContractAddress},
|
||||
ContractAbi: shared.FlapperABI,
|
||||
Topic: shared.FlapKickSignature,
|
||||
TransformerName: constants.FlapKickLabel,
|
||||
ContractAddresses: []string{constants.FlapperContractAddress},
|
||||
ContractAbi: constants.FlapperABI,
|
||||
Topic: constants.FlapKickSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ import (
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/flap_kick"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/test_data"
|
||||
"math/big"
|
||||
"time"
|
||||
@ -31,7 +31,7 @@ var _ = Describe("Flap kick converter", func() {
|
||||
|
||||
Describe("ToEntity", func() {
|
||||
It("converts an Eth Log to a FlapKickEntity", func() {
|
||||
entities, err := converter.ToEntities(shared.FlapperABI, []types.Log{test_data.EthFlapKickLog})
|
||||
entities, err := converter.ToEntities(constants.FlapperABI, []types.Log{test_data.EthFlapKickLog})
|
||||
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(len(entities)).To(Equal(1))
|
||||
|
@ -14,13 +14,16 @@
|
||||
|
||||
package flip_kick
|
||||
|
||||
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var FlipKickConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.FlipKickLabel,
|
||||
ContractAddresses: []string{shared.FlipperContractAddress},
|
||||
ContractAbi: shared.FlipperABI,
|
||||
Topic: shared.FlipKickSignature,
|
||||
TransformerName: constants.FlipKickLabel,
|
||||
ContractAddresses: []string{constants.FlipperContractAddress},
|
||||
ContractAbi: constants.FlipperABI,
|
||||
Topic: constants.FlipKickSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ import (
|
||||
. "github.com/onsi/gomega"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/flip_kick"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/test_data"
|
||||
)
|
||||
|
||||
@ -33,7 +33,7 @@ var _ = Describe("FlipKick Converter", func() {
|
||||
|
||||
Describe("ToEntity", func() {
|
||||
It("converts an Eth Log to a FlipKickEntity", func() {
|
||||
entities, err := converter.ToEntities(shared.FlipperABI, []types.Log{test_data.EthFlipKickLog})
|
||||
entities, err := converter.ToEntities(constants.FlipperABI, []types.Log{test_data.EthFlipKickLog})
|
||||
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(len(entities)).To(Equal(1))
|
||||
|
@ -14,13 +14,16 @@
|
||||
|
||||
package flop_kick
|
||||
|
||||
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var Config = shared.TransformerConfig{
|
||||
TransformerName: shared.FlopKickLabel,
|
||||
ContractAddresses: []string{shared.FlopperContractAddress},
|
||||
ContractAbi: shared.FlopperABI,
|
||||
Topic: shared.FlopKickSignature,
|
||||
TransformerName: constants.FlopKickLabel,
|
||||
ContractAddresses: []string{constants.FlopperContractAddress},
|
||||
ContractAbi: constants.FlopperABI,
|
||||
Topic: constants.FlopKickSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -15,15 +15,15 @@
|
||||
package flop_kick_test
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
|
||||
"encoding/json"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/flop_kick"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/test_data"
|
||||
)
|
||||
|
||||
@ -31,7 +31,7 @@ var _ = Describe("FlopKick Converter", func() {
|
||||
Describe("ToEntities", func() {
|
||||
It("converts a log to a FlopKick entity", func() {
|
||||
converter := flop_kick.FlopKickConverter{}
|
||||
entities, err := converter.ToEntities(shared.FlopperABI, []types.Log{test_data.FlopKickLog})
|
||||
entities, err := converter.ToEntities(constants.FlopperABI, []types.Log{test_data.FlopKickLog})
|
||||
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
entity := entities[0]
|
||||
|
@ -1,50 +0,0 @@
|
||||
// Copyright 2018 Vulcanize
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package flop_kick_test
|
||||
|
||||
import (
|
||||
"github.com/ethereum/go-ethereum/accounts/abi/bind"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/pkg/geth"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/flop_kick"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/test_data"
|
||||
)
|
||||
|
||||
var _ = Describe("Integration tests", func() {
|
||||
It("unpacks an flop kick event log", func() {
|
||||
address := common.HexToAddress(shared.FlopperContractAddress)
|
||||
abi, err := geth.ParseAbi(shared.FlopperABI)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
contract := bind.NewBoundContract(address, abi, nil, nil, nil)
|
||||
entity := &flop_kick.Entity{}
|
||||
|
||||
var eventLog = test_data.FlopKickLog
|
||||
|
||||
err = contract.UnpackLog(entity, "Kick", eventLog)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
expectedEntity := test_data.FlopKickEntity
|
||||
Expect(entity.Id).To(Equal(expectedEntity.Id))
|
||||
Expect(entity.Lot).To(Equal(expectedEntity.Lot))
|
||||
Expect(entity.Bid).To(Equal(expectedEntity.Bid))
|
||||
Expect(entity.Gal).To(Equal(expectedEntity.Gal))
|
||||
Expect(entity.End).To(Equal(expectedEntity.End))
|
||||
})
|
||||
})
|
@ -14,13 +14,16 @@
|
||||
|
||||
package frob
|
||||
|
||||
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var FrobConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.FrobLabel,
|
||||
ContractAddresses: []string{shared.PitContractAddress},
|
||||
ContractAbi: shared.PitABI,
|
||||
Topic: shared.FrobSignature,
|
||||
TransformerName: constants.FrobLabel,
|
||||
ContractAddresses: []string{constants.PitContractAddress},
|
||||
ContractAbi: constants.PitABI,
|
||||
Topic: constants.FrobSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -15,19 +15,19 @@
|
||||
package frob_test
|
||||
|
||||
import (
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/frob"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/test_data"
|
||||
)
|
||||
|
||||
var _ = Describe("Frob converter", func() {
|
||||
var converter = frob.FrobConverter{}
|
||||
It("converts a log to an entity", func() {
|
||||
entities, err := converter.ToEntities(shared.PitABI, []types.Log{test_data.EthFrobLog})
|
||||
entities, err := converter.ToEntities(constants.PitABI, []types.Log{test_data.EthFrobLog})
|
||||
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(len(entities)).To(Equal(1))
|
||||
|
@ -20,10 +20,12 @@ import (
|
||||
|
||||
"github.com/ethereum/go-ethereum/accounts/abi/bind"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/pkg/geth"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/bite"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/factories"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/test_data"
|
||||
"github.com/vulcanize/vulcanizedb/test_config"
|
||||
)
|
||||
@ -71,8 +73,8 @@ var _ = Describe("Bite Transformer", func() {
|
||||
})
|
||||
|
||||
It("unpacks an event log", func() {
|
||||
address := common.HexToAddress(shared.CatContractAddress)
|
||||
abi, err := geth.ParseAbi(shared.CatABI)
|
||||
address := common.HexToAddress(constants.CatContractAddress)
|
||||
abi, err := geth.ParseAbi(constants.CatABI)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
contract := bind.NewBoundContract(address, abi, nil, nil, nil)
|
||||
|
@ -18,13 +18,14 @@ import (
|
||||
"github.com/ethereum/go-ethereum/ethclient"
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/factories"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/pkg/core"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/geth/client"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/deal"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/factories"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"github.com/vulcanize/vulcanizedb/test_config"
|
||||
)
|
||||
|
||||
@ -72,7 +73,7 @@ var _ = Describe("Deal transformer", func() {
|
||||
|
||||
Expect(len(dbResult)).To(Equal(1))
|
||||
Expect(dbResult[0].BidId).To(Equal("6"))
|
||||
Expect(dbResult[0].ContractAddress).To(Equal(shared.FlipperContractAddress))
|
||||
Expect(dbResult[0].ContractAddress).To(Equal(constants.FlipperContractAddress))
|
||||
})
|
||||
|
||||
It("persists a flop deal log event", func() {
|
||||
@ -104,6 +105,6 @@ var _ = Describe("Deal transformer", func() {
|
||||
|
||||
Expect(len(dbResult)).To(Equal(1))
|
||||
Expect(dbResult[0].BidId).To(Equal("1"))
|
||||
Expect(dbResult[0].ContractAddress).To(Equal(shared.FlapperContractAddress))
|
||||
Expect(dbResult[0].ContractAddress).To(Equal(constants.FlapperContractAddress))
|
||||
})
|
||||
})
|
||||
|
@ -15,24 +15,26 @@
|
||||
package integration_tests
|
||||
|
||||
import (
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/accounts/abi/bind"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/pkg/geth"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/factories"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/flip_kick"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/test_data"
|
||||
"github.com/vulcanize/vulcanizedb/test_config"
|
||||
"time"
|
||||
)
|
||||
|
||||
var _ = Describe("FlipKick Transformer", func() {
|
||||
It("unpacks an event log", func() {
|
||||
address := common.HexToAddress(shared.FlipperContractAddress)
|
||||
abi, err := geth.ParseAbi(shared.FlipperABI)
|
||||
address := common.HexToAddress(constants.FlipperContractAddress)
|
||||
abi, err := geth.ParseAbi(constants.FlipperABI)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
contract := bind.NewBoundContract(address, abi, nil, nil, nil)
|
||||
|
@ -17,12 +17,17 @@ package integration_tests
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/accounts/abi/bind"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/pkg/geth"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/factories"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/flop_kick"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/test_data"
|
||||
"github.com/vulcanize/vulcanizedb/test_config"
|
||||
)
|
||||
|
||||
@ -105,4 +110,25 @@ var _ = Describe("FlopKick Transformer", func() {
|
||||
Expect(dbResult[0].Gal).To(Equal("0x3728e9777B2a0a611ee0F89e00E01044ce4736d1"))
|
||||
Expect(dbResult[0].Lot).To(Equal("115792089237316195423570985008687907853269984665640564039457584007913129639935"))
|
||||
})
|
||||
|
||||
It("unpacks an flop kick event log", func() {
|
||||
address := common.HexToAddress(constants.FlopperContractAddress)
|
||||
abi, err := geth.ParseAbi(constants.FlopperABI)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
contract := bind.NewBoundContract(address, abi, nil, nil, nil)
|
||||
entity := &flop_kick.Entity{}
|
||||
|
||||
var eventLog = test_data.FlopKickLog
|
||||
|
||||
err = contract.UnpackLog(entity, "Kick", eventLog)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
expectedEntity := test_data.FlopKickEntity
|
||||
Expect(entity.Id).To(Equal(expectedEntity.Id))
|
||||
Expect(entity.Lot).To(Equal(expectedEntity.Lot))
|
||||
Expect(entity.Bid).To(Equal(expectedEntity.Bid))
|
||||
Expect(entity.Gal).To(Equal(expectedEntity.Gal))
|
||||
Expect(entity.End).To(Equal(expectedEntity.End))
|
||||
})
|
||||
})
|
||||
|
@ -24,6 +24,7 @@ import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/factories"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/frob"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/test_data"
|
||||
"github.com/vulcanize/vulcanizedb/test_config"
|
||||
)
|
||||
@ -71,8 +72,8 @@ var _ = Describe("Frob Transformer", func() {
|
||||
})
|
||||
|
||||
It("unpacks an event log", func() {
|
||||
address := common.HexToAddress(shared.PitContractAddress)
|
||||
abi, err := geth.ParseAbi(shared.PitABI)
|
||||
address := common.HexToAddress(constants.PitContractAddress)
|
||||
abi, err := geth.ParseAbi(constants.PitABI)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
contract := bind.NewBoundContract(address, abi, nil, nil, nil)
|
||||
|
@ -23,6 +23,7 @@ import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/factories"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/price_feeds"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"github.com/vulcanize/vulcanizedb/test_config"
|
||||
)
|
||||
|
||||
@ -46,7 +47,7 @@ var _ = Describe("Price feeds transformer", func() {
|
||||
err := persistHeader(db, blockNumber)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
config := price_feeds.PriceFeedConfig
|
||||
config.ContractAddresses = []string{shared.PipContractAddress}
|
||||
config.ContractAddresses = []string{constants.PipContractAddress}
|
||||
config.StartingBlockNumber = blockNumber
|
||||
config.EndingBlockNumber = blockNumber
|
||||
|
||||
@ -73,7 +74,7 @@ var _ = Describe("Price feeds transformer", func() {
|
||||
err := persistHeader(db, blockNumber)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
config := price_feeds.PriceFeedConfig
|
||||
config.ContractAddresses = []string{shared.PepContractAddress}
|
||||
config.ContractAddresses = []string{constants.PepContractAddress}
|
||||
config.StartingBlockNumber = blockNumber
|
||||
config.EndingBlockNumber = blockNumber
|
||||
|
||||
@ -100,7 +101,7 @@ var _ = Describe("Price feeds transformer", func() {
|
||||
err := persistHeader(db, blockNumber)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
config := price_feeds.PriceFeedConfig
|
||||
config.ContractAddresses = []string{shared.RepContractAddress}
|
||||
config.ContractAddresses = []string{constants.RepContractAddress}
|
||||
config.StartingBlockNumber = blockNumber
|
||||
config.EndingBlockNumber = blockNumber
|
||||
|
||||
|
@ -16,13 +16,14 @@ package debt_ceiling
|
||||
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var DebtCeilingFileConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.PitFileDebtCeilingLabel,
|
||||
ContractAddresses: []string{shared.PitContractAddress},
|
||||
ContractAbi: shared.PitABI,
|
||||
Topic: shared.PitFileDebtCeilingSignature,
|
||||
TransformerName: constants.PitFileDebtCeilingLabel,
|
||||
ContractAddresses: []string{constants.PitContractAddress},
|
||||
ContractAbi: constants.PitABI,
|
||||
Topic: constants.PitFileDebtCeilingSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -16,12 +16,12 @@ package debt_ceiling
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"math/big"
|
||||
|
||||
"bytes"
|
||||
"errors"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
)
|
||||
|
||||
type PitFileDebtCeilingConverter struct{}
|
||||
@ -56,7 +56,7 @@ func verifyLog(log types.Log) error {
|
||||
if len(log.Topics) < 2 {
|
||||
return errors.New("log missing topics")
|
||||
}
|
||||
if len(log.Data) < shared.DataItemLength {
|
||||
if len(log.Data) < constants.DataItemLength {
|
||||
return errors.New("log missing data")
|
||||
}
|
||||
return nil
|
||||
|
@ -16,13 +16,14 @@ package ilk
|
||||
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var IlkFileConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.PitFileIlkLabel,
|
||||
ContractAddresses: []string{shared.PitContractAddress},
|
||||
ContractAbi: shared.PitABI,
|
||||
Topic: shared.PitFileIlkSignature,
|
||||
TransformerName: constants.PitFileIlkLabel,
|
||||
ContractAddresses: []string{constants.PitContractAddress},
|
||||
ContractAbi: constants.PitABI,
|
||||
Topic: constants.PitFileIlkSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -21,7 +21,8 @@ import (
|
||||
"math/big"
|
||||
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
type PitFileIlkConverter struct{}
|
||||
@ -35,7 +36,7 @@ func (PitFileIlkConverter) ToModels(ethLogs []types.Log) ([]interface{}, error)
|
||||
}
|
||||
ilk := string(bytes.Trim(ethLog.Topics[2].Bytes(), "\x00"))
|
||||
what := string(bytes.Trim(ethLog.Topics[3].Bytes(), "\x00"))
|
||||
riskBytes := ethLog.Data[len(ethLog.Data)-shared.DataItemLength:]
|
||||
riskBytes := ethLog.Data[len(ethLog.Data)-constants.DataItemLength:]
|
||||
risk := big.NewInt(0).SetBytes(riskBytes).String()
|
||||
|
||||
raw, err := json.Marshal(ethLog)
|
||||
@ -59,7 +60,7 @@ func verifyLog(log types.Log) error {
|
||||
if len(log.Topics) < 4 {
|
||||
return errors.New("log missing topics")
|
||||
}
|
||||
if len(log.Data) < shared.DataItemLength {
|
||||
if len(log.Data) < constants.DataItemLength {
|
||||
return errors.New("log missing data")
|
||||
}
|
||||
return nil
|
||||
|
@ -16,13 +16,14 @@ package stability_fee
|
||||
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var StabilityFeeFileConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.PitFileStabilityFeeLabel,
|
||||
ContractAddresses: []string{shared.PitContractAddress},
|
||||
ContractAbi: shared.PitABI,
|
||||
Topic: shared.PitFileStabilityFeeSignature,
|
||||
TransformerName: constants.PitFileStabilityFeeLabel,
|
||||
ContractAddresses: []string{constants.PitContractAddress},
|
||||
ContractAbi: constants.PitABI,
|
||||
Topic: constants.PitFileStabilityFeeSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -14,17 +14,20 @@
|
||||
|
||||
package price_feeds
|
||||
|
||||
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var PriceFeedConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.PriceFeedLabel,
|
||||
TransformerName: constants.PriceFeedLabel,
|
||||
ContractAddresses: []string{
|
||||
shared.PepContractAddress,
|
||||
shared.PipContractAddress,
|
||||
shared.RepContractAddress,
|
||||
constants.PepContractAddress,
|
||||
constants.PipContractAddress,
|
||||
constants.RepContractAddress,
|
||||
},
|
||||
ContractAbi: shared.MedianizerABI,
|
||||
Topic: shared.LogValueSignature,
|
||||
ContractAbi: constants.MedianizerABI,
|
||||
Topic: constants.LogValueSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -1,34 +1,6 @@
|
||||
// Copyright 2018 Vulcanize
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package shared
|
||||
|
||||
import (
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
func getContractValue(key string, fallback string) string {
|
||||
value := viper.GetString(key)
|
||||
if value == "" {
|
||||
return fallback
|
||||
}
|
||||
return value
|
||||
}
|
||||
package constants
|
||||
|
||||
var (
|
||||
DataItemLength = 32
|
||||
|
||||
CatABI = `[{"constant":true,"inputs":[],"name":"vat","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x36569e77"},{"constant":true,"inputs":[],"name":"vow","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x626cb3c5"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"flips","outputs":[{"name":"ilk","type":"bytes32"},{"name":"urn","type":"bytes32"},{"name":"ink","type":"uint256"},{"name":"tab","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x70d9235a"},{"constant":true,"inputs":[],"name":"nflip","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x76181a51"},{"constant":true,"inputs":[],"name":"live","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x957aa58c"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xbf353dbb"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"ilks","outputs":[{"name":"flip","type":"address"},{"name":"chop","type":"uint256"},{"name":"lump","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xd9638d36"},{"constant":true,"inputs":[],"name":"pit","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xf03c7c6e"},{"inputs":[{"name":"vat_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor","signature":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"ilk","type":"bytes32"},{"indexed":true,"name":"urn","type":"bytes32"},{"indexed":false,"name":"ink","type":"uint256"},{"indexed":false,"name":"art","type":"uint256"},{"indexed":false,"name":"tab","type":"uint256"},{"indexed":false,"name":"flip","type":"uint256"},{"indexed":false,"name":"iArt","type":"uint256"}],"name":"Bite","type":"event","signature":"0x99b5620489b6ef926d4518936cfec15d305452712b88bd59da2d9c10fb0953e8"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event","signature":"0x644843f351d3fba4abcd60109eaff9f54bac8fb8ccf0bab941009c21df21cf31"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x65fae35e"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x9c52a7f1"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"what","type":"bytes32"},{"name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x1a0b287e"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"data","type":"address"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xd4e8be83"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"what","type":"bytes32"},{"name":"flip","type":"address"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xebecb39d"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"urn","type":"bytes32"}],"name":"bite","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x72f7b593"},{"constant":false,"inputs":[{"name":"n","type":"uint256"},{"name":"wad","type":"uint256"}],"name":"flip","outputs":[{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xe6f95917"}]`
|
||||
DripABI = `[{"constant":true,"inputs":[],"name":"vat","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x36569e77"},{"constant":true,"inputs":[],"name":"repo","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x56ff3122"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xbf353dbb"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"ilks","outputs":[{"name":"vow","type":"bytes32"},{"name":"tax","type":"uint256"},{"name":"rho","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xd9638d36"},{"inputs":[{"name":"vat_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor","signature":"constructor"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event","signature":"0x644843f351d3fba4abcd60109eaff9f54bac8fb8ccf0bab941009c21df21cf31"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x65fae35e"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x9c52a7f1"},{"constant":true,"inputs":[],"name":"era","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x143e55e0"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"vow","type":"bytes32"},{"name":"tax","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x1a0b287e"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x29ae8114"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"}],"name":"drip","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x44e2a5a8"}]`
|
||||
FlapperABI = `[{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"bids","outputs":[{"name":"bid","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"guy","type":"address"},{"name":"tic","type":"uint48"},{"name":"end","type":"uint48"},{"name":"gal","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ttl","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"gem","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"beg","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tau","outputs":[{"name":"","type":"uint48"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"kicks","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"dai","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"dai_","type":"address"},{"name":"gem_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"lot","type":"uint256"},{"indexed":false,"name":"bid","type":"uint256"},{"indexed":false,"name":"gal","type":"address"},{"indexed":false,"name":"end","type":"uint48"}],"name":"Kick","type":"event"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event"},{"constant":false,"inputs":[{"name":"gal","type":"address"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"kick","outputs":[{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"},{"name":"lot","type":"uint256"},{"name":"bid","type":"uint256"}],"name":"tend","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"}],"name":"deal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]`
|
||||
@ -38,108 +10,4 @@ var (
|
||||
PitABI = `[{"constant":true,"inputs":[],"name":"vat","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x36569e77"},{"constant":true,"inputs":[],"name":"live","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x957aa58c"},{"constant":true,"inputs":[],"name":"drip","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x9f678cca"},{"constant":true,"inputs":[],"name":"Line","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xbabe8a3f"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xbf353dbb"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"ilks","outputs":[{"name":"spot","type":"uint256"},{"name":"line","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xd9638d36"},{"inputs":[{"name":"vat_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor","signature":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"ilk","type":"bytes32"},{"indexed":true,"name":"urn","type":"bytes32"},{"indexed":false,"name":"ink","type":"uint256"},{"indexed":false,"name":"art","type":"uint256"},{"indexed":false,"name":"dink","type":"int256"},{"indexed":false,"name":"dart","type":"int256"},{"indexed":false,"name":"iArt","type":"uint256"}],"name":"Frob","type":"event","signature":"0xb2afa28318bcc689926b52835d844de174ef8de97e982a85c0199d584920791b"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event","signature":"0x644843f351d3fba4abcd60109eaff9f54bac8fb8ccf0bab941009c21df21cf31"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x65fae35e"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x9c52a7f1"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"what","type":"bytes32"},{"name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x1a0b287e"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x29ae8114"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"data","type":"address"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xd4e8be83"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"dink","type":"int256"},{"name":"dart","type":"int256"}],"name":"frob","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x5a984ded"}]`
|
||||
VatABI = `[{"constant":true,"inputs":[],"name":"debt","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x0dca59c1"},{"constant":true,"inputs":[{"name":"","type":"bytes32"},{"name":"","type":"bytes32"}],"name":"urns","outputs":[{"name":"ink","type":"uint256"},{"name":"art","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x26e27482"},{"constant":true,"inputs":[],"name":"vice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0x2d61a355"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"sin","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xa60f1d3e"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xbf353dbb"},{"constant":true,"inputs":[{"name":"","type":"bytes32"},{"name":"","type":"bytes32"}],"name":"gem","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xc0912683"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"ilks","outputs":[{"name":"take","type":"uint256"},{"name":"rate","type":"uint256"},{"name":"Ink","type":"uint256"},{"name":"Art","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xd9638d36"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"dai","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function","signature":"0xf53e4e69"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor","signature":"constructor"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":true,"name":"too","type":"bytes32"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"Note","type":"event","signature":"0x8c2dbbc2b33ffaa77c104b777e574a8a4ff79829dfee8b66f4dc63e3f8067152"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x65fae35e"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x9c52a7f1"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"}],"name":"init","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x3b663195"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"guy","type":"bytes32"},{"name":"rad","type":"int256"}],"name":"slip","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x42066cbb"},{"constant":false,"inputs":[{"name":"ilk","type":"bytes32"},{"name":"src","type":"bytes32"},{"name":"dst","type":"bytes32"},{"name":"rad","type":"int256"}],"name":"flux","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xa6e41821"},{"constant":false,"inputs":[{"name":"src","type":"bytes32"},{"name":"dst","type":"bytes32"},{"name":"rad","type":"int256"}],"name":"move","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x78f19470"},{"constant":false,"inputs":[{"name":"i","type":"bytes32"},{"name":"u","type":"bytes32"},{"name":"v","type":"bytes32"},{"name":"w","type":"bytes32"},{"name":"dink","type":"int256"},{"name":"dart","type":"int256"}],"name":"tune","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x5dd6471a"},{"constant":false,"inputs":[{"name":"i","type":"bytes32"},{"name":"u","type":"bytes32"},{"name":"v","type":"bytes32"},{"name":"w","type":"bytes32"},{"name":"dink","type":"int256"},{"name":"dart","type":"int256"}],"name":"grab","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x3690ae4c"},{"constant":false,"inputs":[{"name":"u","type":"bytes32"},{"name":"v","type":"bytes32"},{"name":"rad","type":"int256"}],"name":"heal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x990a5f63"},{"constant":false,"inputs":[{"name":"i","type":"bytes32"},{"name":"u","type":"bytes32"},{"name":"rate","type":"int256"}],"name":"fold","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0xe6a6a64d"},{"constant":false,"inputs":[{"name":"i","type":"bytes32"},{"name":"u","type":"bytes32"},{"name":"take","type":"int256"}],"name":"toll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","signature":"0x09b7a0b5"}]`
|
||||
VowABI = `[{"constant":true,"inputs":[],"name":"Awe","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"Joy","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"flap","outputs":[{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"hump","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"wad","type":"uint256"}],"name":"kiss","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"data","type":"uint256"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"Ash","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"era","type":"uint48"}],"name":"flog","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"vat","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"Woe","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"wait","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"rely","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"bump","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"tab","type":"uint256"}],"name":"fess","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"row","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint48"}],"name":"sin","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"guy","type":"address"}],"name":"deny","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"flop","outputs":[{"name":"id","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"wards","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"sump","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"Sin","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"what","type":"bytes32"},{"name":"addr","type":"address"}],"name":"file","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"cow","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"wad","type":"uint256"}],"name":"heal","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event"}]`
|
||||
|
||||
// temporary addresses from Kovan deployment
|
||||
CatContractAddress = getContractValue("contract.cat", "0x2f34f22a00ee4b7a8f8bbc4eaee1658774c624e0")
|
||||
DripContractAddress = getContractValue("contract.drip", "0x891c04639a5edcae088e546fa125b5d7fb6a2b9d")
|
||||
FlapperContractAddress = getContractValue("contract.mcd_flap", "0x8868BAd8e74FcA4505676D1B5B21EcC23328d132") // MCD FLAP Contract
|
||||
FlipperContractAddress = getContractValue("contract.eth_flip", "0x32D496Ad866D110060866B7125981C73642cc509") // ETH FLIP Contract
|
||||
FlopperContractAddress = getContractValue("contract.mcd_flop", "0x6191C9b0086c2eBF92300cC507009b53996FbFFa") // MCD FLOP Contract
|
||||
PepContractAddress = getContractValue("contract.pep", "0xB1997239Cfc3d15578A3a09730f7f84A90BB4975")
|
||||
PipContractAddress = getContractValue("contract.pip", "0x9FfFE440258B79c5d6604001674A4722FfC0f7Bc")
|
||||
PitContractAddress = getContractValue("contract.pit", "0xe7cf3198787c9a4daac73371a38f29aaeeced87e")
|
||||
RepContractAddress = getContractValue("contract.rep", "0xf88bBDc1E2718F8857F30A180076ec38d53cf296")
|
||||
VatContractAddress = getContractValue("contract.vat", "0xcd726790550afcd77e9a7a47e86a3f9010af126b")
|
||||
VowContractAddress = getContractValue("contract.vow", "0x3728e9777B2a0a611ee0F89e00E01044ce4736d1")
|
||||
|
||||
//TODO: get cat, pit, and drip file method signatures directly from the ABI
|
||||
biteMethod = GetSolidityMethodSignature(CatABI, "Bite")
|
||||
catFileChopLumpMethod = "file(bytes32,bytes32,uint256)"
|
||||
catFileFlipMethod = GetSolidityMethodSignature(CatABI, "file")
|
||||
catFilePitVowMethod = "file(bytes32,address)"
|
||||
dealMethod = GetSolidityMethodSignature(FlipperABI, "deal")
|
||||
dentMethod = GetSolidityMethodSignature(FlipperABI, "dent")
|
||||
dripDripMethod = GetSolidityMethodSignature(DripABI, "drip")
|
||||
dripFileIlkMethod = "file(bytes32,bytes32,uint256)"
|
||||
dripFileRepoMethod = GetSolidityMethodSignature(DripABI, "file")
|
||||
dripFileVowMethod = "file(bytes32,bytes32)"
|
||||
flapKickMethod = GetSolidityMethodSignature(FlapperABI, "Kick")
|
||||
flipKickMethod = GetSolidityMethodSignature(FlipperABI, "Kick")
|
||||
flopKickMethod = GetSolidityMethodSignature(FlopperABI, "Kick")
|
||||
frobMethod = GetSolidityMethodSignature(PitABI, "Frob")
|
||||
logValueMethod = GetSolidityMethodSignature(MedianizerABI, "LogValue")
|
||||
pitFileDebtCeilingMethod = "file(bytes32,uint256)"
|
||||
pitFileIlkMethod = "file(bytes32,bytes32,uint256)"
|
||||
pitFileStabilityFeeMethod = GetSolidityMethodSignature(PitABI, "file")
|
||||
tendMethod = GetSolidityMethodSignature(FlipperABI, "tend")
|
||||
vatFluxMethod = GetSolidityMethodSignature(VatABI, "flux")
|
||||
vatFoldMethod = GetSolidityMethodSignature(VatABI, "fold")
|
||||
vatGrabMethod = GetSolidityMethodSignature(VatABI, "grab")
|
||||
vatHealMethod = GetSolidityMethodSignature(VatABI, "heal")
|
||||
vatInitMethod = GetSolidityMethodSignature(VatABI, "init")
|
||||
vatMoveMethod = GetSolidityMethodSignature(VatABI, "move")
|
||||
vatSlipMethod = GetSolidityMethodSignature(VatABI, "slip")
|
||||
vatTollMethod = GetSolidityMethodSignature(VatABI, "toll")
|
||||
vatTuneMethod = GetSolidityMethodSignature(VatABI, "tune")
|
||||
vowFlogMethod = GetSolidityMethodSignature(VowABI, "flog")
|
||||
|
||||
BiteSignature = GetEventSignature(biteMethod)
|
||||
CatFileChopLumpSignature = GetLogNoteSignature(catFileChopLumpMethod)
|
||||
CatFileFlipSignature = GetLogNoteSignature(catFileFlipMethod)
|
||||
CatFilePitVowSignature = GetLogNoteSignature(catFilePitVowMethod)
|
||||
DealSignature = GetLogNoteSignature(dealMethod)
|
||||
DentFunctionSignature = GetLogNoteSignature(dentMethod)
|
||||
DripDripSignature = GetLogNoteSignature(dripDripMethod)
|
||||
DripFileIlkSignature = GetLogNoteSignature(dripFileIlkMethod)
|
||||
DripFileRepoSignature = GetLogNoteSignature(dripFileRepoMethod)
|
||||
DripFileVowSignature = GetLogNoteSignature(dripFileVowMethod)
|
||||
FlapKickSignature = GetEventSignature(flapKickMethod)
|
||||
FlipKickSignature = GetEventSignature(flipKickMethod)
|
||||
FlopKickSignature = GetEventSignature(flopKickMethod)
|
||||
FrobSignature = GetEventSignature(frobMethod)
|
||||
LogValueSignature = GetEventSignature(logValueMethod)
|
||||
PitFileDebtCeilingSignature = GetLogNoteSignature(pitFileDebtCeilingMethod)
|
||||
PitFileIlkSignature = GetLogNoteSignature(pitFileIlkMethod)
|
||||
PitFileStabilityFeeSignature = GetLogNoteSignature(pitFileStabilityFeeMethod)
|
||||
TendFunctionSignature = GetLogNoteSignature(tendMethod)
|
||||
VatFluxSignature = GetLogNoteSignature(vatFluxMethod)
|
||||
VatFoldSignature = GetLogNoteSignature(vatFoldMethod)
|
||||
VatGrabSignature = GetLogNoteSignature(vatGrabMethod)
|
||||
VatHealSignature = GetLogNoteSignature(vatHealMethod)
|
||||
VatInitSignature = GetLogNoteSignature(vatInitMethod)
|
||||
VatMoveSignature = GetLogNoteSignature(vatMoveMethod)
|
||||
VatSlipSignature = GetLogNoteSignature(vatSlipMethod)
|
||||
VatTollSignature = GetLogNoteSignature(vatTollMethod)
|
||||
VatTuneSignature = GetLogNoteSignature(vatTuneMethod)
|
||||
VowFlogSignature = GetLogNoteSignature(vowFlogMethod)
|
||||
|
||||
BiteLabel = "bite"
|
||||
CatFileChopLumpLabel = "catFileChopLump"
|
||||
CatFileFlipLabel = "catFileFlip"
|
||||
CatFilePitVowLabel = "catFilePitVow"
|
||||
DealLabel = "deal"
|
||||
DentLabel = "dent"
|
||||
DripDripLabel = "dripDrip"
|
||||
DripFileIlkLabel = "dripFileIlk"
|
||||
DripFileRepoLabel = "dripFileRepo"
|
||||
DripFileVowLabel = "dripFileVow"
|
||||
FlapKickLabel = "flapKick"
|
||||
FlipKickLabel = "flipKick"
|
||||
FlopKickLabel = "flopKick"
|
||||
FrobLabel = "frob"
|
||||
PitFileDebtCeilingLabel = "pitFileDebtCeiling"
|
||||
PitFileIlkLabel = "pitFileIlk"
|
||||
PitFileStabilityFeeLabel = "pitFileStabilityFee"
|
||||
PriceFeedLabel = "priceFeed"
|
||||
TendLabel = "tend"
|
||||
VatFluxLabel = "vatFlux"
|
||||
VatFoldLabel = "vatFold"
|
||||
VatGrabLabel = "vatGrab"
|
||||
VatHealLabel = "vatHeal"
|
||||
VatInitLabel = "vatInit"
|
||||
VatMoveLabel = "vatMove"
|
||||
VatSlipLabel = "vatSlip"
|
||||
VatTollLabel = "vatToll"
|
||||
VatTuneLabel = "vatTune"
|
||||
VowFlogLabel = "vowFlog"
|
||||
)
|
26
pkg/transformers/shared/constants/address.go
Normal file
26
pkg/transformers/shared/constants/address.go
Normal file
@ -0,0 +1,26 @@
|
||||
package constants
|
||||
|
||||
import "github.com/spf13/viper"
|
||||
|
||||
func getContractValue(key string, fallback string) string {
|
||||
value := viper.GetString(key)
|
||||
if value == "" {
|
||||
return fallback
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
var (
|
||||
// temporary addresses from Kovan deployment
|
||||
CatContractAddress = getContractValue("contract.cat", "0x2f34f22a00ee4b7a8f8bbc4eaee1658774c624e0")
|
||||
DripContractAddress = getContractValue("contract.drip", "0x891c04639a5edcae088e546fa125b5d7fb6a2b9d")
|
||||
FlapperContractAddress = getContractValue("contract.mcd_flap", "0x8868BAd8e74FcA4505676D1B5B21EcC23328d132") // MCD FLAP Contract
|
||||
FlipperContractAddress = getContractValue("contract.eth_flip", "0x32D496Ad866D110060866B7125981C73642cc509") // ETH FLIP Contract
|
||||
FlopperContractAddress = getContractValue("contract.mcd_flop", "0x6191C9b0086c2eBF92300cC507009b53996FbFFa") // MCD FLOP Contract
|
||||
PepContractAddress = getContractValue("contract.pep", "0xB1997239Cfc3d15578A3a09730f7f84A90BB4975")
|
||||
PipContractAddress = getContractValue("contract.pip", "0x9FfFE440258B79c5d6604001674A4722FfC0f7Bc")
|
||||
PitContractAddress = getContractValue("contract.pit", "0xe7cf3198787c9a4daac73371a38f29aaeeced87e")
|
||||
RepContractAddress = getContractValue("contract.rep", "0xf88bBDc1E2718F8857F30A180076ec38d53cf296")
|
||||
VatContractAddress = getContractValue("contract.vat", "0xcd726790550afcd77e9a7a47e86a3f9010af126b")
|
||||
VowContractAddress = getContractValue("contract.vow", "0x3728e9777B2a0a611ee0F89e00E01044ce4736d1")
|
||||
)
|
13
pkg/transformers/shared/constants/constants_suite_test.go
Normal file
13
pkg/transformers/shared/constants/constants_suite_test.go
Normal file
@ -0,0 +1,13 @@
|
||||
package constants_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
)
|
||||
|
||||
func TestConstants(t *testing.T) {
|
||||
RegisterFailHandler(Fail)
|
||||
RunSpecs(t, "Constants Suite")
|
||||
}
|
3
pkg/transformers/shared/constants/data.go
Normal file
3
pkg/transformers/shared/constants/data.go
Normal file
@ -0,0 +1,3 @@
|
||||
package constants
|
||||
|
||||
var DataItemLength = 32
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package shared
|
||||
package constants
|
||||
|
||||
import (
|
||||
"fmt"
|
@ -12,48 +12,47 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package shared_test
|
||||
package constants_test
|
||||
|
||||
import (
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var _ = Describe("Event signature generator", func() {
|
||||
Describe("generating non-anonymous event signatures", func() {
|
||||
It("generates bite event signature", func() {
|
||||
expected := "0x99b5620489b6ef926d4518936cfec15d305452712b88bd59da2d9c10fb0953e8"
|
||||
actual := shared.GetEventSignature("Bite(bytes32,bytes32,uint256,uint256,uint256,uint256,uint256)")
|
||||
actual := constants.GetEventSignature("Bite(bytes32,bytes32,uint256,uint256,uint256,uint256,uint256)")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
|
||||
It("generates frob event signature", func() {
|
||||
expected := "0xb2afa28318bcc689926b52835d844de174ef8de97e982a85c0199d584920791b"
|
||||
actual := shared.GetEventSignature("Frob(bytes32,bytes32,uint256,uint256,int256,int256,uint256)")
|
||||
actual := constants.GetEventSignature("Frob(bytes32,bytes32,uint256,uint256,int256,int256,uint256)")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
|
||||
It("generates the flap kick event signature", func() {
|
||||
expected := "0xefa52d9342a199cb30efd2692463f2c2bef63cd7186b50382d4fb94ad207880e"
|
||||
actual := shared.GetEventSignature("Kick(uint256,uint256,uint256,address,uint48)")
|
||||
actual := constants.GetEventSignature("Kick(uint256,uint256,uint256,address,uint48)")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
|
||||
It("generates flip kick event signature", func() {
|
||||
expected := "0xbac86238bdba81d21995024470425ecb370078fa62b7271b90cf28cbd1e3e87e"
|
||||
actual := shared.GetEventSignature("Kick(uint256,uint256,uint256,address,uint48,bytes32,uint256)")
|
||||
actual := constants.GetEventSignature("Kick(uint256,uint256,uint256,address,uint48,bytes32,uint256)")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
|
||||
It("generates log value event signature", func() {
|
||||
expected := "0x296ba4ca62c6c21c95e828080cb8aec7481b71390585605300a8a76f9e95b527"
|
||||
actual := shared.GetEventSignature("LogValue(bytes32)")
|
||||
actual := constants.GetEventSignature("LogValue(bytes32)")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
@ -62,28 +61,28 @@ var _ = Describe("Event signature generator", func() {
|
||||
Describe("generating LogNote event signatures", func() {
|
||||
It("generates flip tend event signature", func() {
|
||||
expected := "0x4b43ed1200000000000000000000000000000000000000000000000000000000"
|
||||
actual := shared.GetLogNoteSignature("tend(uint256,uint256,uint256)")
|
||||
actual := constants.GetLogNoteSignature("tend(uint256,uint256,uint256)")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
|
||||
It("generates pit file event signature for overloaded function with three arguments", func() {
|
||||
expected := "0x1a0b287e00000000000000000000000000000000000000000000000000000000"
|
||||
actual := shared.GetLogNoteSignature("file(bytes32,bytes32,uint256)")
|
||||
actual := constants.GetLogNoteSignature("file(bytes32,bytes32,uint256)")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
|
||||
It("generates pit file event signature for overloaded function with two arguments", func() {
|
||||
expected := "0x29ae811400000000000000000000000000000000000000000000000000000000"
|
||||
actual := shared.GetLogNoteSignature("file(bytes32,uint256)")
|
||||
actual := constants.GetLogNoteSignature("file(bytes32,uint256)")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
|
||||
It("generates pit file event signature for overloaded function with two different arguments", func() {
|
||||
expected := "0xd4e8be8300000000000000000000000000000000000000000000000000000000"
|
||||
actual := shared.GetLogNoteSignature("file(bytes32,address)")
|
||||
actual := constants.GetLogNoteSignature("file(bytes32,address)")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
@ -94,7 +93,7 @@ var _ = Describe("Event signature generator", func() {
|
||||
Describe("from the cat contract", func() {
|
||||
It("gets the file method signature", func() {
|
||||
expected := "file(bytes32,bytes32,address)"
|
||||
actual := shared.GetSolidityMethodSignature(shared.CatABI, "file")
|
||||
actual := constants.GetSolidityMethodSignature(constants.CatABI, "file")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
@ -103,14 +102,14 @@ var _ = Describe("Event signature generator", func() {
|
||||
Describe("from the drip contract", func() {
|
||||
It("gets the drip method signature", func() {
|
||||
expected := "drip(bytes32)"
|
||||
actual := shared.GetSolidityMethodSignature(shared.DripABI, "drip")
|
||||
actual := constants.GetSolidityMethodSignature(constants.DripABI, "drip")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
|
||||
It("gets the file method signature", func() {
|
||||
expected := "file(bytes32,uint256)"
|
||||
actual := shared.GetSolidityMethodSignature(shared.DripABI, "file")
|
||||
actual := constants.GetSolidityMethodSignature(constants.DripABI, "file")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
@ -119,21 +118,21 @@ var _ = Describe("Event signature generator", func() {
|
||||
Describe("from the flipper contract", func() {
|
||||
It("gets the deal method signature", func() {
|
||||
expected := "deal(uint256)"
|
||||
actual := shared.GetSolidityMethodSignature(shared.FlipperABI, "deal")
|
||||
actual := constants.GetSolidityMethodSignature(constants.FlipperABI, "deal")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
|
||||
It("gets the dent method signature", func() {
|
||||
expected := "dent(uint256,uint256,uint256)"
|
||||
actual := shared.GetSolidityMethodSignature(shared.FlipperABI, "dent")
|
||||
actual := constants.GetSolidityMethodSignature(constants.FlipperABI, "dent")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
|
||||
It("gets the tend method signature", func() {
|
||||
expected := "tend(uint256,uint256,uint256)"
|
||||
actual := shared.GetSolidityMethodSignature(shared.FlipperABI, "tend")
|
||||
actual := constants.GetSolidityMethodSignature(constants.FlipperABI, "tend")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
@ -142,7 +141,7 @@ var _ = Describe("Event signature generator", func() {
|
||||
Describe("from the pit contract", func() {
|
||||
It("gets the file method signature", func() {
|
||||
expected := "file(bytes32,address)"
|
||||
actual := shared.GetSolidityMethodSignature(shared.PitABI, "file")
|
||||
actual := constants.GetSolidityMethodSignature(constants.PitABI, "file")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
@ -151,63 +150,63 @@ var _ = Describe("Event signature generator", func() {
|
||||
Describe("from the vat contract", func() {
|
||||
It("gets the init method signature", func() {
|
||||
expected := "init(bytes32)"
|
||||
actual := shared.GetSolidityMethodSignature(shared.VatABI, "init")
|
||||
actual := constants.GetSolidityMethodSignature(constants.VatABI, "init")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
|
||||
It("gets the heal method signature", func() {
|
||||
expected := "heal(bytes32,bytes32,int256)"
|
||||
actual := shared.GetSolidityMethodSignature(shared.VatABI, "heal")
|
||||
actual := constants.GetSolidityMethodSignature(constants.VatABI, "heal")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
|
||||
It("gets the fold method signature", func() {
|
||||
expected := "fold(bytes32,bytes32,int256)"
|
||||
actual := shared.GetSolidityMethodSignature(shared.VatABI, "fold")
|
||||
actual := constants.GetSolidityMethodSignature(constants.VatABI, "fold")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
|
||||
It("gets the flux method signature", func() {
|
||||
expected := "flux(bytes32,bytes32,bytes32,int256)"
|
||||
actual := shared.GetSolidityMethodSignature(shared.VatABI, "flux")
|
||||
actual := constants.GetSolidityMethodSignature(constants.VatABI, "flux")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
|
||||
It("gets the grab method signature", func() {
|
||||
expected := "grab(bytes32,bytes32,bytes32,bytes32,int256,int256)"
|
||||
actual := shared.GetSolidityMethodSignature(shared.VatABI, "grab")
|
||||
actual := constants.GetSolidityMethodSignature(constants.VatABI, "grab")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
|
||||
It("gets the move method signature", func() {
|
||||
expected := "move(bytes32,bytes32,int256)"
|
||||
actual := shared.GetSolidityMethodSignature(shared.VatABI, "move")
|
||||
actual := constants.GetSolidityMethodSignature(constants.VatABI, "move")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
|
||||
It("gets the slip method signature", func() {
|
||||
expected := "slip(bytes32,bytes32,int256)"
|
||||
actual := shared.GetSolidityMethodSignature(shared.VatABI, "slip")
|
||||
actual := constants.GetSolidityMethodSignature(constants.VatABI, "slip")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
|
||||
It("gets the toll method signature", func() {
|
||||
expected := "toll(bytes32,bytes32,int256)"
|
||||
actual := shared.GetSolidityMethodSignature(shared.VatABI, "toll")
|
||||
actual := constants.GetSolidityMethodSignature(constants.VatABI, "toll")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
|
||||
It("gets the tune method signature", func() {
|
||||
expected := "tune(bytes32,bytes32,bytes32,bytes32,int256,int256)"
|
||||
actual := shared.GetSolidityMethodSignature(shared.VatABI, "tune")
|
||||
actual := constants.GetSolidityMethodSignature(constants.VatABI, "tune")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
@ -216,7 +215,7 @@ var _ = Describe("Event signature generator", func() {
|
||||
Describe("from the vow contract", func() {
|
||||
It("gets the flog method signature", func() {
|
||||
expected := "flog(uint48)"
|
||||
actual := shared.GetSolidityMethodSignature(shared.VowABI, "flog")
|
||||
actual := constants.GetSolidityMethodSignature(constants.VowABI, "flog")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
@ -226,42 +225,42 @@ var _ = Describe("Event signature generator", func() {
|
||||
Describe("it handles events", func() {
|
||||
It("gets the Bite event signature", func() {
|
||||
expected := "Bite(bytes32,bytes32,uint256,uint256,uint256,uint256,uint256)"
|
||||
actual := shared.GetSolidityMethodSignature(shared.CatABI, "Bite")
|
||||
actual := constants.GetSolidityMethodSignature(constants.CatABI, "Bite")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
|
||||
It("gets the flap Kick event signature", func() {
|
||||
expected := "Kick(uint256,uint256,uint256,address,uint48)"
|
||||
actual := shared.GetSolidityMethodSignature(shared.FlapperABI, "Kick")
|
||||
actual := constants.GetSolidityMethodSignature(constants.FlapperABI, "Kick")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
|
||||
It("gets the flip Kick event signature", func() {
|
||||
expected := "Kick(uint256,uint256,uint256,address,uint48,bytes32,uint256)"
|
||||
actual := shared.GetSolidityMethodSignature(shared.FlipperABI, "Kick")
|
||||
actual := constants.GetSolidityMethodSignature(constants.FlipperABI, "Kick")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
|
||||
It("gets the flop Kick event signature", func() {
|
||||
expected := "Kick(uint256,uint256,uint256,address,uint48)"
|
||||
actual := shared.GetSolidityMethodSignature(shared.FlopperABI, "Kick")
|
||||
actual := constants.GetSolidityMethodSignature(constants.FlopperABI, "Kick")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
|
||||
It("gets the pit frob event signature", func() {
|
||||
expected := "Frob(bytes32,bytes32,uint256,uint256,int256,int256,uint256)"
|
||||
actual := shared.GetSolidityMethodSignature(shared.PitABI, "Frob")
|
||||
actual := constants.GetSolidityMethodSignature(constants.PitABI, "Frob")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
||||
|
||||
It("gets the log value method signature", func() {
|
||||
expected := "LogValue(bytes32)"
|
||||
actual := shared.GetSolidityMethodSignature(shared.MedianizerABI, "LogValue")
|
||||
actual := constants.GetSolidityMethodSignature(constants.MedianizerABI, "LogValue")
|
||||
|
||||
Expect(expected).To(Equal(actual))
|
||||
})
|
33
pkg/transformers/shared/constants/label.go
Normal file
33
pkg/transformers/shared/constants/label.go
Normal file
@ -0,0 +1,33 @@
|
||||
package constants
|
||||
|
||||
var (
|
||||
BiteLabel = "bite"
|
||||
CatFileChopLumpLabel = "catFileChopLump"
|
||||
CatFileFlipLabel = "catFileFlip"
|
||||
CatFilePitVowLabel = "catFilePitVow"
|
||||
DealLabel = "deal"
|
||||
DentLabel = "dent"
|
||||
DripDripLabel = "dripDrip"
|
||||
DripFileIlkLabel = "dripFileIlk"
|
||||
DripFileRepoLabel = "dripFileRepo"
|
||||
DripFileVowLabel = "dripFileVow"
|
||||
FlapKickLabel = "flapKick"
|
||||
FlipKickLabel = "flipKick"
|
||||
FlopKickLabel = "flopKick"
|
||||
FrobLabel = "frob"
|
||||
PitFileDebtCeilingLabel = "pitFileDebtCeiling"
|
||||
PitFileIlkLabel = "pitFileIlk"
|
||||
PitFileStabilityFeeLabel = "pitFileStabilityFee"
|
||||
PriceFeedLabel = "priceFeed"
|
||||
TendLabel = "tend"
|
||||
VatFluxLabel = "vatFlux"
|
||||
VatFoldLabel = "vatFold"
|
||||
VatGrabLabel = "vatGrab"
|
||||
VatHealLabel = "vatHeal"
|
||||
VatInitLabel = "vatInit"
|
||||
VatMoveLabel = "vatMove"
|
||||
VatSlipLabel = "vatSlip"
|
||||
VatTollLabel = "vatToll"
|
||||
VatTuneLabel = "vatTune"
|
||||
VowFlogLabel = "vowFlog"
|
||||
)
|
34
pkg/transformers/shared/constants/method.go
Normal file
34
pkg/transformers/shared/constants/method.go
Normal file
@ -0,0 +1,34 @@
|
||||
package constants
|
||||
|
||||
var (
|
||||
//TODO: get cat, pit, and drip file method signatures directly from the ABI
|
||||
biteMethod = GetSolidityMethodSignature(CatABI, "Bite")
|
||||
catFileChopLumpMethod = "file(bytes32,bytes32,uint256)"
|
||||
catFileFlipMethod = GetSolidityMethodSignature(CatABI, "file")
|
||||
catFilePitVowMethod = "file(bytes32,address)"
|
||||
dealMethod = GetSolidityMethodSignature(FlipperABI, "deal")
|
||||
dentMethod = GetSolidityMethodSignature(FlipperABI, "dent")
|
||||
dripDripMethod = GetSolidityMethodSignature(DripABI, "drip")
|
||||
dripFileIlkMethod = "file(bytes32,bytes32,uint256)"
|
||||
dripFileRepoMethod = GetSolidityMethodSignature(DripABI, "file")
|
||||
dripFileVowMethod = "file(bytes32,bytes32)"
|
||||
flapKickMethod = GetSolidityMethodSignature(FlapperABI, "Kick")
|
||||
flipKickMethod = GetSolidityMethodSignature(FlipperABI, "Kick")
|
||||
flopKickMethod = GetSolidityMethodSignature(FlopperABI, "Kick")
|
||||
frobMethod = GetSolidityMethodSignature(PitABI, "Frob")
|
||||
logValueMethod = GetSolidityMethodSignature(MedianizerABI, "LogValue")
|
||||
pitFileDebtCeilingMethod = "file(bytes32,uint256)"
|
||||
pitFileIlkMethod = "file(bytes32,bytes32,uint256)"
|
||||
pitFileStabilityFeeMethod = GetSolidityMethodSignature(PitABI, "file")
|
||||
tendMethod = GetSolidityMethodSignature(FlipperABI, "tend")
|
||||
vatFluxMethod = GetSolidityMethodSignature(VatABI, "flux")
|
||||
vatFoldMethod = GetSolidityMethodSignature(VatABI, "fold")
|
||||
vatGrabMethod = GetSolidityMethodSignature(VatABI, "grab")
|
||||
vatHealMethod = GetSolidityMethodSignature(VatABI, "heal")
|
||||
vatInitMethod = GetSolidityMethodSignature(VatABI, "init")
|
||||
vatMoveMethod = GetSolidityMethodSignature(VatABI, "move")
|
||||
vatSlipMethod = GetSolidityMethodSignature(VatABI, "slip")
|
||||
vatTollMethod = GetSolidityMethodSignature(VatABI, "toll")
|
||||
vatTuneMethod = GetSolidityMethodSignature(VatABI, "tune")
|
||||
vowFlogMethod = GetSolidityMethodSignature(VowABI, "flog")
|
||||
)
|
33
pkg/transformers/shared/constants/signature.go
Normal file
33
pkg/transformers/shared/constants/signature.go
Normal file
@ -0,0 +1,33 @@
|
||||
package constants
|
||||
|
||||
var (
|
||||
BiteSignature = GetEventSignature(biteMethod)
|
||||
CatFileChopLumpSignature = GetLogNoteSignature(catFileChopLumpMethod)
|
||||
CatFileFlipSignature = GetLogNoteSignature(catFileFlipMethod)
|
||||
CatFilePitVowSignature = GetLogNoteSignature(catFilePitVowMethod)
|
||||
DealSignature = GetLogNoteSignature(dealMethod)
|
||||
DentFunctionSignature = GetLogNoteSignature(dentMethod)
|
||||
DripDripSignature = GetLogNoteSignature(dripDripMethod)
|
||||
DripFileIlkSignature = GetLogNoteSignature(dripFileIlkMethod)
|
||||
DripFileRepoSignature = GetLogNoteSignature(dripFileRepoMethod)
|
||||
DripFileVowSignature = GetLogNoteSignature(dripFileVowMethod)
|
||||
FlapKickSignature = GetEventSignature(flapKickMethod)
|
||||
FlipKickSignature = GetEventSignature(flipKickMethod)
|
||||
FlopKickSignature = GetEventSignature(flopKickMethod)
|
||||
FrobSignature = GetEventSignature(frobMethod)
|
||||
LogValueSignature = GetEventSignature(logValueMethod)
|
||||
PitFileDebtCeilingSignature = GetLogNoteSignature(pitFileDebtCeilingMethod)
|
||||
PitFileIlkSignature = GetLogNoteSignature(pitFileIlkMethod)
|
||||
PitFileStabilityFeeSignature = GetLogNoteSignature(pitFileStabilityFeeMethod)
|
||||
TendFunctionSignature = GetLogNoteSignature(tendMethod)
|
||||
VatFluxSignature = GetLogNoteSignature(vatFluxMethod)
|
||||
VatFoldSignature = GetLogNoteSignature(vatFoldMethod)
|
||||
VatGrabSignature = GetLogNoteSignature(vatGrabMethod)
|
||||
VatHealSignature = GetLogNoteSignature(vatHealMethod)
|
||||
VatInitSignature = GetLogNoteSignature(vatInitMethod)
|
||||
VatMoveSignature = GetLogNoteSignature(vatMoveMethod)
|
||||
VatSlipSignature = GetLogNoteSignature(vatSlipMethod)
|
||||
VatTollSignature = GetLogNoteSignature(vatTollMethod)
|
||||
VatTuneSignature = GetLogNoteSignature(vatTuneMethod)
|
||||
VowFlogSignature = GetLogNoteSignature(vowFlogMethod)
|
||||
)
|
@ -1,17 +1,3 @@
|
||||
// Copyright 2018 Vulcanize
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package shared_test
|
||||
|
||||
import (
|
||||
|
@ -14,7 +14,10 @@
|
||||
|
||||
package shared
|
||||
|
||||
import "math/big"
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"math/big"
|
||||
)
|
||||
|
||||
func BigIntToInt64(value *big.Int) int64 {
|
||||
if value == nil {
|
||||
@ -36,11 +39,11 @@ func BigIntToString(value *big.Int) string {
|
||||
func GetDataBytesAtIndex(n int, logData []byte) []byte {
|
||||
switch {
|
||||
case n == -1:
|
||||
return logData[len(logData)-DataItemLength:]
|
||||
return logData[len(logData)-constants.DataItemLength:]
|
||||
case n == -2:
|
||||
return logData[len(logData)-(2*DataItemLength) : len(logData)-DataItemLength]
|
||||
return logData[len(logData)-(2*constants.DataItemLength) : len(logData)-constants.DataItemLength]
|
||||
case n == -3:
|
||||
return logData[len(logData)-(3*DataItemLength) : len(logData)-(2*DataItemLength)]
|
||||
return logData[len(logData)-(3*constants.DataItemLength) : len(logData)-(2*constants.DataItemLength)]
|
||||
}
|
||||
return []byte{}
|
||||
}
|
||||
|
@ -14,13 +14,16 @@
|
||||
|
||||
package tend
|
||||
|
||||
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var TendConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.TendLabel,
|
||||
ContractAddresses: []string{shared.FlapperContractAddress, shared.FlipperContractAddress},
|
||||
ContractAbi: shared.FlipperABI,
|
||||
Topic: shared.TendFunctionSignature,
|
||||
TransformerName: constants.TendLabel,
|
||||
ContractAddresses: []string{constants.FlapperContractAddress, constants.FlipperContractAddress},
|
||||
ContractAbi: constants.FlipperABI,
|
||||
Topic: constants.TendFunctionSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ import (
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/bite"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"math/big"
|
||||
)
|
||||
|
||||
@ -46,7 +46,7 @@ var (
|
||||
)
|
||||
|
||||
var EthBiteLog = types.Log{
|
||||
Address: common.HexToAddress(shared.CatContractAddress),
|
||||
Address: common.HexToAddress(constants.CatContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash("0x99b5620489b6ef926d4518936cfec15d305452712b88bd59da2d9c10fb0953e8"),
|
||||
common.HexToHash("0x4554480000000000000000000000000000000000000000000000000000000000"),
|
||||
|
@ -22,12 +22,12 @@ import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/cat_file/chop_lump"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/cat_file/flip"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/cat_file/pit_vow"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"math/big"
|
||||
)
|
||||
|
||||
var EthCatFileChopLumpLog = types.Log{
|
||||
Address: common.HexToAddress(shared.CatContractAddress),
|
||||
Address: common.HexToAddress(constants.CatContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash("0x1a0b287e00000000000000000000000000000000000000000000000000000000"),
|
||||
common.HexToHash("0x00000000000000000000000064d922894153be9eef7b7218dc565d1d0ce2a092"),
|
||||
@ -54,7 +54,7 @@ var CatFileChopLumpModel = chop_lump.CatFileChopLumpModel{
|
||||
}
|
||||
|
||||
var EthCatFileFlipLog = types.Log{
|
||||
Address: common.HexToAddress(shared.CatContractAddress),
|
||||
Address: common.HexToAddress(constants.CatContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash("0xebecb39d00000000000000000000000000000000000000000000000000000000"),
|
||||
common.HexToHash("0x00000000000000000000000064d922894153be9eef7b7218dc565d1d0ce2a092"),
|
||||
@ -81,7 +81,7 @@ var CatFileFlipModel = flip.CatFileFlipModel{
|
||||
}
|
||||
|
||||
var EthCatFilePitVowLog = types.Log{
|
||||
Address: common.HexToAddress(shared.CatContractAddress),
|
||||
Address: common.HexToAddress(constants.CatContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash("0xd4e8be8300000000000000000000000000000000000000000000000000000000"),
|
||||
common.HexToHash("0x00000000000000000000000064d922894153be9eef7b7218dc565d1d0ce2a092"),
|
||||
|
@ -20,11 +20,11 @@ import (
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/deal"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var DealLogNote = types.Log{
|
||||
Address: common.HexToAddress(shared.FlipperContractAddress),
|
||||
Address: common.HexToAddress(constants.FlipperContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash("0xc959c42b00000000000000000000000000000000000000000000000000000000"),
|
||||
common.HexToHash("0x00000000000000000000000064d922894153be9eef7b7218dc565d1d0ce2a092"),
|
||||
@ -43,7 +43,7 @@ var dealRawJson, _ = json.Marshal(DealLogNote)
|
||||
|
||||
var DealModel = deal.DealModel{
|
||||
BidId: "123",
|
||||
ContractAddress: shared.FlipperContractAddress,
|
||||
ContractAddress: constants.FlipperContractAddress,
|
||||
LogIndex: DealLogNote.Index,
|
||||
TransactionIndex: DealLogNote.TxIndex,
|
||||
Raw: dealRawJson,
|
||||
|
@ -20,7 +20,7 @@ import (
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/dent"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
@ -37,7 +37,7 @@ var (
|
||||
)
|
||||
|
||||
var DentLog = types.Log{
|
||||
Address: common.HexToAddress(shared.FlipperContractAddress),
|
||||
Address: common.HexToAddress(constants.FlipperContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash("0x5ff3a38200000000000000000000000000000000000000000000000000000000"),
|
||||
common.HexToHash("0x00000000000000000000000064d922894153be9eef7b7218dc565d1d0ce2a092"),
|
||||
|
@ -20,11 +20,11 @@ import (
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/drip_drip"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var EthDripDripLog = types.Log{
|
||||
Address: common.HexToAddress(shared.DripContractAddress),
|
||||
Address: common.HexToAddress(constants.DripContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash("0x44e2a5a800000000000000000000000000000000000000000000000000000000"),
|
||||
common.HexToHash("0x00000000000000000000000064d922894153be9eef7b7218dc565d1d0ce2a092"),
|
||||
|
@ -22,12 +22,12 @@ import (
|
||||
ilk2 "github.com/vulcanize/vulcanizedb/pkg/transformers/drip_file/ilk"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/drip_file/repo"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/drip_file/vow"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"math/big"
|
||||
)
|
||||
|
||||
var EthDripFileIlkLog = types.Log{
|
||||
Address: common.HexToAddress(shared.DripContractAddress),
|
||||
Address: common.HexToAddress(constants.DripContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash("0x1a0b287e00000000000000000000000000000000000000000000000000000000"),
|
||||
common.HexToHash("0x00000000000000000000000064d922894153be9eef7b7218dc565d1d0ce2a092"),
|
||||
@ -54,7 +54,7 @@ var DripFileIlkModel = ilk2.DripFileIlkModel{
|
||||
}
|
||||
|
||||
var EthDripFileRepoLog = types.Log{
|
||||
Address: common.HexToAddress(shared.DripContractAddress),
|
||||
Address: common.HexToAddress(constants.DripContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash("0x29ae811400000000000000000000000000000000000000000000000000000000"),
|
||||
common.HexToHash("0x00000000000000000000000064d922894153be9eef7b7218dc565d1d0ce2a092"),
|
||||
@ -80,7 +80,7 @@ var DripFileRepoModel = repo.DripFileRepoModel{
|
||||
}
|
||||
|
||||
var EthDripFileVowLog = types.Log{
|
||||
Address: common.HexToAddress(shared.DripContractAddress),
|
||||
Address: common.HexToAddress(constants.DripContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash("0xe9b674b900000000000000000000000000000000000000000000000000000000"),
|
||||
common.HexToHash("0x00000000000000000000000064d922894153be9eef7b7218dc565d1d0ce2a092"),
|
||||
|
@ -6,13 +6,13 @@ import (
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/flap_kick"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"math/big"
|
||||
"time"
|
||||
)
|
||||
|
||||
var EthFlapKickLog = types.Log{
|
||||
Address: common.HexToAddress(shared.FlapperContractAddress),
|
||||
Address: common.HexToAddress(constants.FlapperContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash("0xefa52d9342a199cb30efd2692463f2c2bef63cd7186b50382d4fb94ad207880e"),
|
||||
common.HexToHash("0x00000000000000000000000000000000000000000000000000000000069f6bc7"),
|
||||
|
@ -24,7 +24,7 @@ import (
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/flip_kick"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -52,9 +52,9 @@ var (
|
||||
)
|
||||
|
||||
var EthFlipKickLog = types.Log{
|
||||
Address: common.HexToAddress(shared.FlipperContractAddress),
|
||||
Address: common.HexToAddress(constants.FlipperContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash(shared.FlipKickSignature),
|
||||
common.HexToHash(constants.FlipKickSignature),
|
||||
common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000001"),
|
||||
common.HexToHash("0x7340e006f4135ba6970d43bf43d88dcad4e7a8ca000000000000000000000000"),
|
||||
},
|
||||
|
@ -20,7 +20,7 @@ import (
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/flop_kick"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"math/big"
|
||||
"strconv"
|
||||
"time"
|
||||
@ -28,7 +28,7 @@ import (
|
||||
|
||||
var (
|
||||
FlopKickLog = types.Log{
|
||||
Address: common.HexToAddress(shared.FlopperContractAddress),
|
||||
Address: common.HexToAddress(constants.FlopperContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash("0xefa52d9342a199cb30efd2692463f2c2bef63cd7186b50382d4fb94ad207880e"),
|
||||
common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000005"),
|
||||
|
@ -20,7 +20,7 @@ import (
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/frob"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"math/big"
|
||||
)
|
||||
|
||||
@ -46,7 +46,7 @@ var (
|
||||
)
|
||||
|
||||
var EthFrobLog = types.Log{
|
||||
Address: common.HexToAddress(shared.PitContractAddress),
|
||||
Address: common.HexToAddress(constants.PitContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash("0xb2afa28318bcc689926b52835d844de174ef8de97e982a85c0199d584920791b"),
|
||||
common.HexToHash("0x66616b6520696c6b000000000000000000000000000000000000000000000000"),
|
||||
|
@ -25,11 +25,11 @@ import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/pit_file/debt_ceiling"
|
||||
ilk2 "github.com/vulcanize/vulcanizedb/pkg/transformers/pit_file/ilk"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/pit_file/stability_fee"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var EthPitFileDebtCeilingLog = types.Log{
|
||||
Address: common.HexToAddress(shared.PitContractAddress),
|
||||
Address: common.HexToAddress(constants.PitContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash("0x29ae811400000000000000000000000000000000000000000000000000000000"),
|
||||
common.HexToHash("0x00000000000000000000000064d922894153be9eef7b7218dc565d1d0ce2a092"),
|
||||
@ -55,7 +55,7 @@ var PitFileDebtCeilingModel = debt_ceiling.PitFileDebtCeilingModel{
|
||||
}
|
||||
|
||||
var EthPitFileIlkLog = types.Log{
|
||||
Address: common.HexToAddress(shared.PitContractAddress),
|
||||
Address: common.HexToAddress(constants.PitContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash("0x1a0b287e00000000000000000000000000000000000000000000000000000000"),
|
||||
common.HexToHash("0x0000000000000000000000000f243e26db94b5426032e6dfa6007802dea2a614"),
|
||||
|
@ -19,7 +19,7 @@ import (
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/price_feeds"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -31,7 +31,7 @@ var (
|
||||
// https://etherscan.io/tx/0xa51a50a2adbfba4e2ab3d72dfd67a21c769f1bc8d2b180663a15500a56cde58f
|
||||
var EthPriceFeedLog = types.Log{
|
||||
Address: medianizerAddress,
|
||||
Topics: []common.Hash{common.HexToHash(shared.LogValueSignature)},
|
||||
Topics: []common.Hash{common.HexToHash(constants.LogValueSignature)},
|
||||
Data: common.FromHex("00000000000000000000000000000000000000000000001486f658319fb0c100"),
|
||||
BlockNumber: blockNumber,
|
||||
TxHash: common.HexToHash("0xa51a50a2adbfba4e2ab3d72dfd67a21c769f1bc8d2b180663a15500a56cde58f"),
|
||||
|
@ -22,7 +22,7 @@ import (
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/tend"
|
||||
)
|
||||
|
||||
@ -38,7 +38,7 @@ var (
|
||||
)
|
||||
|
||||
var TendLogNote = types.Log{
|
||||
Address: common.HexToAddress(shared.FlipperContractAddress),
|
||||
Address: common.HexToAddress(constants.FlipperContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash("0x4b43ed1200000000000000000000000000000000000000000000000000000000"), //abbreviated tend function signature
|
||||
common.HexToHash("0x0000000000000000000000007d7bee5fcfd8028cf7b00876c5b1421c800561a6"), //msg caller address
|
||||
|
@ -21,11 +21,12 @@ import (
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/vat_flux"
|
||||
)
|
||||
|
||||
var VatFluxLog = types.Log{
|
||||
Address: common.HexToAddress("0x239e6f0ab02713f1f8aa90ebeded9fc66dc96cd6"),
|
||||
Address: common.HexToAddress(constants.VatContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash("0xa6e4182100000000000000000000000000000000000000000000000000000000"),
|
||||
common.HexToHash("0x5245500000000000000000000000000000000000000000000000000000000000"),
|
||||
|
@ -21,12 +21,12 @@ import (
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/vat_fold"
|
||||
)
|
||||
|
||||
var EthVatFoldLog = types.Log{
|
||||
Address: common.HexToAddress(shared.VatContractAddress),
|
||||
Address: common.HexToAddress(constants.VatContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash("0xe6a6a64d00000000000000000000000000000000000000000000000000000000"),
|
||||
common.HexToHash("0x5245500000000000000000000000000000000000000000000000000000000000"),
|
||||
|
@ -5,12 +5,12 @@ import (
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/vat_grab"
|
||||
)
|
||||
|
||||
var EthVatGrabLog = types.Log{
|
||||
Address: common.HexToAddress(shared.VatContractAddress),
|
||||
Address: common.HexToAddress(constants.VatContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash("0x3690ae4c00000000000000000000000000000000000000000000000000000000"),
|
||||
common.HexToHash("0x5245500000000000000000000000000000000000000000000000000000000000"),
|
||||
|
@ -19,11 +19,12 @@ import (
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/vat_heal"
|
||||
)
|
||||
|
||||
var VatHealLog = types.Log{
|
||||
Address: common.HexToAddress("0xa970ed54e41d9db6d91db5e7ff7a9451dad98993"),
|
||||
Address: common.HexToAddress(constants.VatContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash("0x990a5f6300000000000000000000000000000000000000000000000000000000"),
|
||||
common.HexToHash("0x0000000000000000000000007d7bee5fcfd8028cf7b00876c5b1421c800561a6"),
|
||||
|
@ -21,12 +21,12 @@ import (
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/vat_init"
|
||||
)
|
||||
|
||||
var EthVatInitLog = types.Log{
|
||||
Address: common.HexToAddress(shared.VatContractAddress),
|
||||
Address: common.HexToAddress(constants.VatContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash("0x3b66319500000000000000000000000000000000000000000000000000000000"),
|
||||
common.HexToHash("0x66616b6520696c6b000000000000000000000000000000000000000000000000"),
|
||||
|
@ -16,17 +16,17 @@ package test_data
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/vat_move"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/vat_move"
|
||||
)
|
||||
|
||||
var EthVatMoveLog = types.Log{
|
||||
Address: common.HexToAddress(shared.VatContractAddress),
|
||||
Address: common.HexToAddress(constants.VatContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash("0x78f1947000000000000000000000000000000000000000000000000000000000"),
|
||||
common.HexToHash("0x000000000000000000000000a730d1ff8b6bc74a26d54c20a9dda539909bab0e"),
|
||||
|
@ -18,15 +18,15 @@ import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/vat_slip"
|
||||
)
|
||||
|
||||
var EthVatSlipLog = types.Log{
|
||||
Address: common.HexToAddress(shared.VatContractAddress),
|
||||
Address: common.HexToAddress(constants.VatContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash("0x42066cbb00000000000000000000000000000000000000000000000000000000"),
|
||||
common.HexToHash("0x66616b6520696c6b000000000000000000000000000000000000000000000000"),
|
||||
|
@ -5,12 +5,13 @@ import (
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/vat_toll"
|
||||
"math/big"
|
||||
)
|
||||
|
||||
var EthVatTollLog = types.Log{
|
||||
Address: common.HexToAddress("0x239E6f0AB02713f1F8AA90ebeDeD9FC66Dc96CD6"),
|
||||
Address: common.HexToAddress(constants.VatContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash("0x09b7a0b500000000000000000000000000000000000000000000000000000000"),
|
||||
common.HexToHash("0x66616b6520696c6b000000000000000000000000000000000000000000000000"),
|
||||
|
@ -8,11 +8,12 @@ import (
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/vat_tune"
|
||||
)
|
||||
|
||||
var EthVatTuneLog = types.Log{
|
||||
Address: common.HexToAddress("0xCD726790550aFcd77e9a7a47e86A3F9010af126B"),
|
||||
Address: common.HexToAddress(constants.VatContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash("0x5dd6471a00000000000000000000000000000000000000000000000000000000"),
|
||||
common.HexToHash("0x4554480000000000000000000000000000000000000000000000000000000000"),
|
||||
|
@ -19,13 +19,12 @@ import (
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/vow_flog"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
)
|
||||
|
||||
var EthFlogLog = types.Log{
|
||||
Address: common.HexToAddress(shared.VowContractAddress),
|
||||
Address: common.HexToAddress(constants.VowContractAddress),
|
||||
Topics: []common.Hash{
|
||||
common.HexToHash("0x35aee16f00000000000000000000000000000000000000000000000000000000"),
|
||||
common.HexToHash("0x0000000000000000000000008e84a1e068d77059cbe263c43ad0cdc130863313"),
|
||||
|
@ -1,12 +1,15 @@
|
||||
package vat_flux
|
||||
|
||||
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var VatFluxConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.VatFluxLabel,
|
||||
ContractAddresses: []string{shared.VatContractAddress},
|
||||
ContractAbi: shared.VatABI,
|
||||
Topic: shared.VatFluxSignature,
|
||||
TransformerName: constants.VatFluxLabel,
|
||||
ContractAddresses: []string{constants.VatContractAddress},
|
||||
ContractAbi: constants.VatABI,
|
||||
Topic: constants.VatFluxSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -16,13 +16,14 @@ package vat_fold
|
||||
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var VatFoldConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.VatFoldLabel,
|
||||
ContractAddresses: []string{shared.VatContractAddress},
|
||||
ContractAbi: shared.VatABI,
|
||||
Topic: shared.VatFoldSignature,
|
||||
TransformerName: constants.VatFoldLabel,
|
||||
ContractAddresses: []string{constants.VatContractAddress},
|
||||
ContractAbi: constants.VatABI,
|
||||
Topic: constants.VatFoldSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ import (
|
||||
"errors"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
type VatFoldConverter struct{}
|
||||
@ -62,7 +62,7 @@ func verifyLog(log types.Log) error {
|
||||
}
|
||||
|
||||
sig := log.Topics[0].String()
|
||||
if sig != shared.VatFoldSignature {
|
||||
if sig != constants.VatFoldSignature {
|
||||
return errors.New("log is not a Vat.fold event")
|
||||
}
|
||||
|
||||
|
@ -1,12 +1,15 @@
|
||||
package vat_grab
|
||||
|
||||
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var VatGrabConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.VatGrabLabel,
|
||||
ContractAddresses: []string{shared.VatContractAddress},
|
||||
ContractAbi: shared.VatABI,
|
||||
Topic: shared.VatGrabSignature,
|
||||
TransformerName: constants.VatGrabLabel,
|
||||
ContractAddresses: []string{constants.VatContractAddress},
|
||||
ContractAbi: constants.VatABI,
|
||||
Topic: constants.VatGrabSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import (
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"math/big"
|
||||
)
|
||||
|
||||
@ -53,7 +54,7 @@ func verifyLog(log types.Log) error {
|
||||
if len(log.Topics) < 4 {
|
||||
return errors.New("log missing topics")
|
||||
}
|
||||
if len(log.Data) < shared.DataItemLength {
|
||||
if len(log.Data) < constants.DataItemLength {
|
||||
return errors.New("log missing data")
|
||||
}
|
||||
return nil
|
||||
|
@ -14,13 +14,16 @@
|
||||
|
||||
package vat_heal
|
||||
|
||||
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var VatHealConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.VatHealLabel,
|
||||
ContractAddresses: []string{shared.VatContractAddress},
|
||||
ContractAbi: shared.VatABI,
|
||||
Topic: shared.VatHealSignature,
|
||||
TransformerName: constants.VatHealLabel,
|
||||
ContractAddresses: []string{constants.VatContractAddress},
|
||||
ContractAbi: constants.VatABI,
|
||||
Topic: constants.VatHealSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -16,13 +16,14 @@ package vat_init
|
||||
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var VatInitConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.VatInitLabel,
|
||||
ContractAddresses: []string{shared.VatContractAddress},
|
||||
ContractAbi: shared.VatABI,
|
||||
Topic: shared.VatInitSignature,
|
||||
TransformerName: constants.VatInitLabel,
|
||||
ContractAddresses: []string{constants.VatContractAddress},
|
||||
ContractAbi: constants.VatABI,
|
||||
Topic: constants.VatInitSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -16,13 +16,14 @@ package vat_move
|
||||
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var VatMoveConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.VatMoveLabel,
|
||||
ContractAddresses: []string{shared.VatContractAddress},
|
||||
ContractAbi: shared.VatABI,
|
||||
Topic: shared.VatMoveSignature,
|
||||
TransformerName: constants.VatMoveLabel,
|
||||
ContractAddresses: []string{constants.VatContractAddress},
|
||||
ContractAbi: constants.VatABI,
|
||||
Topic: constants.VatMoveSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -1,12 +1,15 @@
|
||||
package vat_slip
|
||||
|
||||
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var VatSlipConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.VatSlipLabel,
|
||||
ContractAddresses: []string{shared.VatContractAddress},
|
||||
ContractAbi: shared.VatABI,
|
||||
Topic: shared.VatSlipSignature,
|
||||
TransformerName: constants.VatSlipLabel,
|
||||
ContractAddresses: []string{constants.VatContractAddress},
|
||||
ContractAbi: constants.VatABI,
|
||||
Topic: constants.VatSlipSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -1,12 +1,15 @@
|
||||
package vat_toll
|
||||
|
||||
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var VatTollConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.VatTollLabel,
|
||||
ContractAddresses: []string{shared.VatContractAddress},
|
||||
ContractAbi: shared.VatABI,
|
||||
Topic: shared.VatTollSignature,
|
||||
TransformerName: constants.VatTollLabel,
|
||||
ContractAddresses: []string{constants.VatContractAddress},
|
||||
ContractAbi: constants.VatABI,
|
||||
Topic: constants.VatTollSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -1,12 +1,15 @@
|
||||
package vat_tune
|
||||
|
||||
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var VatTuneConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.VatTuneLabel,
|
||||
ContractAddresses: []string{shared.VatContractAddress},
|
||||
ContractAbi: shared.VatABI,
|
||||
Topic: shared.VatTuneSignature,
|
||||
TransformerName: constants.VatTuneLabel,
|
||||
ContractAddresses: []string{constants.VatContractAddress},
|
||||
ContractAbi: constants.VatABI,
|
||||
Topic: constants.VatTuneSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -6,10 +6,11 @@ import (
|
||||
"errors"
|
||||
"math/big"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
type VatTuneConverter struct{}
|
||||
@ -55,7 +56,7 @@ func verifyLog(log types.Log) error {
|
||||
if len(log.Topics) < 4 {
|
||||
return errors.New("log missing topics")
|
||||
}
|
||||
if len(log.Data) < shared.DataItemLength {
|
||||
if len(log.Data) < constants.DataItemLength {
|
||||
return errors.New("log missing data")
|
||||
}
|
||||
return nil
|
||||
|
@ -14,13 +14,16 @@
|
||||
|
||||
package vow_flog
|
||||
|
||||
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
import (
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
var VowFlogConfig = shared.TransformerConfig{
|
||||
TransformerName: shared.VowFlogLabel,
|
||||
ContractAddresses: []string{shared.VowContractAddress},
|
||||
ContractAbi: shared.VowABI,
|
||||
Topic: shared.VowFlogSignature,
|
||||
TransformerName: constants.VowFlogLabel,
|
||||
ContractAddresses: []string{constants.VowContractAddress},
|
||||
ContractAbi: constants.VowABI,
|
||||
Topic: constants.VowFlogSignature,
|
||||
StartingBlockNumber: 0,
|
||||
EndingBlockNumber: 10000000,
|
||||
}
|
||||
|
@ -18,8 +18,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
type VowFlogConverter struct{}
|
||||
@ -53,7 +52,7 @@ func verifyLog(log types.Log) error {
|
||||
if len(log.Topics) < 3 {
|
||||
return errors.New("log missing topics")
|
||||
}
|
||||
if len(log.Data) < shared.DataItemLength {
|
||||
if len(log.Data) < constants.DataItemLength {
|
||||
return errors.New("log missing data")
|
||||
}
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user