Add and use transformer labels in shared constants

This commit is contained in:
Edvard 2018-10-23 11:19:36 +02:00
parent f55449d0e5
commit a0deb5eb62
11 changed files with 64 additions and 36 deletions

View File

@ -86,33 +86,33 @@ func getTransformerInititalizers(transformerNames []string) []shared2.Transforme
func buildTransformerInitializerMap() map[string]shared2.TransformerInitializer {
transformerInitializerMap := make(map[string]shared2.TransformerInitializer)
transformerInitializerMap["bite"] = transformers.BiteTransformerInitializer
transformerInitializerMap["catFileChopLump"] = transformers.CatFileChopLumpTransformerInitializer
transformerInitializerMap["catFileFlip"] = transformers.CatFileFlipTransformerInitializer
transformerInitializerMap["catFilePitVow"] = transformers.CatFilePitVowTransformerInitializer
transformerInitializerMap["deal"] = transformers.DealTransformerInitializer
transformerInitializerMap["dent"] = transformers.DentTransformerInitializer
transformerInitializerMap["dripDrip"] = transformers.DripDripTransformerInitializer
transformerInitializerMap["dripFileIlk"] = transformers.DripFileIlkTransformerInitializer
transformerInitializerMap["dripFileRepo"] = transformers.DripFileRepoTransformerInitializer
transformerInitializerMap["dripFileVow"] = transformers.DripFileVowTransfromerInitializer
transformerInitializerMap["flipKick"] = transformers.FlipKickTransformerInitializer
transformerInitializerMap["flopKick"] = transformers.FlopKickTransformerInitializer
transformerInitializerMap["frob"] = transformers.FrobTransformerInitializer
transformerInitializerMap["pitFileDebtCeiling"] = transformers.PitFileDebtCeilingTransformerInitializer
transformerInitializerMap["pitFileIlk"] = transformers.PitFileIlkTransformerInitializer
transformerInitializerMap["pitFileStabilityFee"] = transformers.PitFileStabilityFeeTransformerInitializer
transformerInitializerMap["priceFeed"] = transformers.PriceFeedTransformerInitializer
transformerInitializerMap["tend"] = transformers.TendTransformerInitializer
transformerInitializerMap["vatGrab"] = transformers.VatGrabTransformerInitializer
transformerInitializerMap["vatInit"] = transformers.VatInitTransformerInitializer
transformerInitializerMap["vatMove"] = transformers.VatMoveTransformerInitializer
transformerInitializerMap["vatHeal"] = transformers.VatHealTransformerInitializer
transformerInitializerMap["vatFold"] = transformers.VatFoldTransformerInitializer
transformerInitializerMap["vatSlip"] = transformers.VatSlipTransformerInitializer
transformerInitializerMap["vatToll"] = transformers.VatTollTransformerInitializer
transformerInitializerMap["vatTune"] = transformers.VatTuneTransformerInitializer
transformerInitializerMap["vatFlux"] = transformers.VatFluxTransformerInitializer
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.FlipKickLabel] = transformers.FlipKickTransformerInitializer
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
return transformerInitializerMap
}

View File

@ -17,7 +17,7 @@ package ilk
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
var DripFileIlkConfig = shared.SingleTransformerConfig{
TransformerName: "drip file ilk",
TransformerName: shared.DripFileIlkLabel,
ContractAddresses: []string{shared.DripContractAddress},
ContractAbi: shared.DripABI,
Topic: shared.DripFileIlkSignature,

View File

@ -17,7 +17,7 @@ package repo
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
var DripFileRepoConfig = shared.SingleTransformerConfig{
TransformerName: "drip file repo",
TransformerName: shared.DripFileRepoLabel,
ContractAddresses: []string{shared.DripContractAddress},
ContractAbi: shared.DripABI,
Topic: shared.DripFileRepoSignature,

View File

@ -17,7 +17,7 @@ package vow
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
var DripFileVowConfig = shared.SingleTransformerConfig{
TransformerName: "drip file vow",
TransformerName: shared.DripFileVowLabel,
ContractAddresses: []string{shared.DripContractAddress},
ContractAbi: shared.DripABI,
Topic: shared.DripFileVowSignature,

View File

@ -19,7 +19,7 @@ import (
)
var DebtCeilingFileConfig = shared.SingleTransformerConfig{
TransformerName: "pit file debt ceiling",
TransformerName: shared.PitFileDebtCeilingLabel,
ContractAddresses: []string{shared.PitContractAddress},
ContractAbi: shared.PitABI,
Topic: shared.PitFileDebtCeilingSignature,

View File

@ -19,7 +19,7 @@ import (
)
var IlkFileConfig = shared.SingleTransformerConfig{
TransformerName: "pit file ilk",
TransformerName: shared.PitFileIlkLabel,
ContractAddresses: []string{shared.PitContractAddress},
ContractAbi: shared.PitABI,
Topic: shared.PitFileIlkSignature,

View File

@ -19,7 +19,7 @@ import (
)
var StabilityFeeFileConfig = shared.SingleTransformerConfig{
TransformerName: "pit file stability fee",
TransformerName: shared.PitFileStabilityFeeLabel,
ContractAddresses: []string{shared.PitContractAddress},
ContractAbi: shared.PitABI,
Topic: shared.PitFileStabilityFeeSignature,

View File

@ -102,4 +102,32 @@ var (
VatTollSignature = GetLogNoteSignature(vatTollMethod)
VatTuneSignature = GetLogNoteSignature(vatTuneMethod)
VatFluxSignature = GetLogNoteSignature(vatFluxMethod)
BiteLabel = "bite"
DealLabel = "deal"
CatFileChopLumpLabel = "catFileChopLump"
CatFileFlipLabel = "catFileFlip"
CatFilePitVowLabel = "catFilePitVow"
DentLabel = "dent"
DripDripLabel = "dripDrip"
DripFileIlkLabel = "dripFileIlk"
DripFileRepoLabel = "dripFileRepo"
DripFileVowLabel = "dripFileVow"
FlipKickLabel = "flipKick"
FlopKickLabel = "flopKick"
FrobLabel = "frob"
PitFileDebtCeilingLabel = "pitFileDebtCeiling"
PitFileIlkLabel = "pitFileIlk"
PitFileStabilityFeeLabel = "pitFileStabilityFee"
PriceFeedLabel = "priceFeed"
TendLabel = "tend"
VatHealLabel = "vatHeal"
VatGrabLabel = "vatGrab"
VatInitLabel = "vatInit"
VatMoveLabel = "vatMove"
VatFoldLabel = "vatFold"
VatSlipLabel = "vatSlip"
VatTollLabel = "vatToll"
VatTuneLabel = "vatTune"
VatFluxLabel = "vatFlux"
)

View File

@ -17,7 +17,7 @@ package tend
import "github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
var TendConfig = shared.SingleTransformerConfig{
TransformerName: "tend",
TransformerName: shared.TendLabel,
ContractAddresses: []string{shared.FlipperContractAddress},
ContractAbi: shared.FlipperABI,
Topic: shared.TendFunctionSignature,

View File

@ -19,7 +19,7 @@ import (
)
var VatInitConfig = shared.SingleTransformerConfig{
TransformerName: "vat init",
TransformerName: shared.VatInitLabel,
ContractAddresses: []string{shared.VatContractAddress},
ContractAbi: shared.VatABI,
Topic: shared.VatInitSignature,

View File

@ -19,7 +19,7 @@ import (
)
var VatMoveConfig = shared.SingleTransformerConfig{
TransformerName: "vat move",
TransformerName: shared.VatMoveLabel,
ContractAddresses: []string{shared.VatContractAddress},
ContractAbi: shared.VatABI,
Topic: shared.VatMoveSignature,