ipld-eth-server/libraries/shared/handler_interface.go
Matt Krump 06f78e0083 Handle events
- Adds interfaces for developers to build handlers that update data in
response to log events
- Resolves #29
2018-03-05 10:01:50 -06:00

24 lines
543 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 Handler interface {
Execute() error
}
type HandlerInitializer func(db *postgres.DB, blockchain core.ContractDataFetcher) Handler
func HexToInt64(byteString string) int64 {
intHash := common.HexToHash(byteString)
return intHash.Big().Int64()
}
func HexToString(byteString string) string {
value := common.HexToHash(byteString)
return value.Big().String()
}