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
@@ -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,
}
+2 -3
View File
@@ -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