Extract constants package

- Reduce clutter in the shared package
This commit is contained in:
Rob Mulholand
2018-11-08 13:08:59 -06:00
parent 8c5192f82f
commit 8c168ed332
87 changed files with 604 additions and 542 deletions
+8 -5
View File
@@ -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,
}
+3 -2
View File
@@ -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