event

package
v0.4.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2019 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	EventKey     = "event"
	EventDataKey = EventKey + ".data"
	EventNameKey = EventKey + ".name"

	AddressKey           = "address"
	ContractKey          = "contract"
	ContractAddressKey   = ContractKey + "." + AddressKey
	ContractEventDataKey = ContractKey + "." + EventDataKey
	ContractEventNameKey = ContractKey + "." + EventNameKey
)

Variables

This section is empty.

Functions

func FilterContractEvents

func FilterContractEvents(events []types.Event, eventName, eventValue string) ([]types.Event, error)

FilterContractEvents returns events that includes a given event name and value. (value is optional)

func GetContractEventsFromResultTx

func GetContractEventsFromResultTx(contractAddr common.Address, result *ctypes.ResultTx) ([]types.Event, error)

GetContractEventsFromResultTx returns events that matches a given contract address from ResultTx.

func MakeEntryBytes

func MakeEntryBytes(name, value string) ([]byte, error)

func MakeEventSearchQuery

func MakeEventSearchQuery(contractAddr common.Address, eventName, eventValue string) (string, error)

MakeEventSearchQuery returns a query for searching events on transaction contractAddr: target contract address eventName: event name eventValue: value corresponding to event name. NOTE: if value has a prefix "0x", value will be decoded into []byte

func MakeTMEvent

func MakeTMEvent(contractAddr common.Address, es []*Entry) (*types.Event, error)

func MakeTMEvents

func MakeTMEvents(evs []*Event) (types.Events, error)

Types

type Entry

type Entry struct {
	Name  []byte
	Value []byte
}

func GetEntryFromEvent

func GetEntryFromEvent(ev types.Event) ([]*Entry, error)

func MakeEntry

func MakeEntry(name, value string) (*Entry, error)

func ParseEntry

func ParseEntry(hexStrBytes []byte) (*Entry, error)

func (Entry) Bytes

func (e Entry) Bytes() []byte

func (Entry) String

func (e Entry) String() string

func (Entry) Validate

func (e Entry) Validate() error

type Event

type Event struct {
	// contains filtered or unexported fields
}

func NewEvent

func NewEvent(address common.Address, entries []*Entry) *Event

func (Event) Address

func (es Event) Address() common.Address

func (Event) Entries

func (es Event) Entries() []*Entry

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL