2018-02-13 16:31:57 +00:00
|
|
|
package shared
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/ethereum/go-ethereum/common"
|
|
|
|
"github.com/vulcanize/vulcanizedb/pkg/core"
|
|
|
|
"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres"
|
|
|
|
)
|
|
|
|
|
2018-03-16 19:34:18 +00:00
|
|
|
type Transformer interface {
|
2018-02-13 16:31:57 +00:00
|
|
|
Execute() error
|
|
|
|
}
|
|
|
|
|
2018-07-20 16:37:46 +00:00
|
|
|
type TransformerInitializer func(db *postgres.DB, blockchain core.BlockChain) Transformer
|
2018-02-13 16:31:57 +00:00
|
|
|
|
|
|
|
func HexToInt64(byteString string) int64 {
|
2018-03-16 19:34:18 +00:00
|
|
|
value := common.HexToHash(byteString)
|
|
|
|
return value.Big().Int64()
|
2018-02-13 16:31:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func HexToString(byteString string) string {
|
|
|
|
value := common.HexToHash(byteString)
|
|
|
|
return value.Big().String()
|
|
|
|
}
|