func NewEvent(eventType string, contractName string, contractAddress common.Address, timestamp int64,
	retrievalMethod RetrievalMethod, eventPayload map[string]interface{}, logPayload *types.Log) (*Event, error) {
	event := &Event{}
	event.eventType = eventType
	event.contractName = contractName
	event.contractAddress = contractAddress
	event.eventPayload = eventPayload
	event.logPayload = logPayload
	event.timestamp = timestamp
	event.retrievalMethod = retrievalMethod
	event.eventHash = event.hashEvent()
	return event, nil
}
NewEvent is a convenience function to create a new Event
package model  
import (
	"fmt"
	"math/big"
	"reflect"
	"strconv"
	"strings"
	log "github.com/golang/glog"
	"github.com/pkg/errors"
	specs "github.com/joincivil/civil-events-crawler/pkg/contractspecs"
	"github.com/ethereum/go-ethereum/accounts/abi"
	"github.com/ethereum/go-ethereum/common"
	"github.com/ethereum/go-ethereum/core/types"
	"github.com/ethereum/go-ethereum/crypto"
	"github.com/ethereum/go-ethereum/rlp"
	"github.com/fatih/structs"
)
const (
	Filterer RetrievalMethod = iota
	Watcher
)
type RetrievalMethod int
func ReturnEventFromABI(_abi abi.ABI, eventType string) (abi.Event, error) {
	event, ok := _abi.Events[eventType]
	if !ok {
		event, ok = _abi.Events[fmt.Sprintf("_%s", eventType)]
		if !ok {
			return abi.Event{}, errors.Errorf("no event type %v in contract", eventType)
		}
	}
	return event, nil
}
func NewEventFromContractEvent(eventType string, contractName string, contractAddress common.Address,
	eventData interface{}, timestamp int64, retrievalMethod RetrievalMethod) (*Event, error) {
	event := &Event{}
	payload := NewEventPayload(eventData)
	logPayload, err := extractRawFieldFromEvent(payload)
	if err != nil {
		return event, err
	}
	eventPayload, err := extractFieldsFromEvent(payload, eventData, eventType, contractName)
	if err != nil {
		return event, err
	}
	event, err = NewEvent(eventType, contractName, contractAddress, timestamp, retrievalMethod, eventPayload, logPayload)
	return event, err
}