forked from cerc-io/ipld-eth-server
Extract constants package
- Reduce clutter in the shared package
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user