ba071ef13f
- Migrate various mocks of core namespaces to shared version in `fakes` pkg - Err on the side of making test doubles less sophisticated - Don't pull over mocks of namespaces that are only used in example code
24 lines
542 B
Go
24 lines
542 B
Go
package shared
|
|
|
|
import (
|
|
"github.com/ethereum/go-ethereum/common"
|
|
"github.com/vulcanize/vulcanizedb/pkg/core"
|
|
"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres"
|
|
)
|
|
|
|
type Transformer interface {
|
|
Execute() error
|
|
}
|
|
|
|
type TransformerInitializer func(db *postgres.DB, blockchain core.BlockChain) Transformer
|
|
|
|
func HexToInt64(byteString string) int64 {
|
|
value := common.HexToHash(byteString)
|
|
return value.Big().Int64()
|
|
}
|
|
|
|
func HexToString(byteString string) string {
|
|
value := common.HexToHash(byteString)
|
|
return value.Big().String()
|
|
}
|