event

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EventKey

func EventKey(eventName, contractName, chainRid string) []byte

EventKey 生成eventKey

@param eventName
@param contractName
@param chainRid
@return []byte

func InitEventManager

func InitEventManager()

InitEventManager 初始化跨链触发器

Types

type EventInfo

type EventInfo struct {
	Topic        string
	ChainRid     string
	ContractName string
	TxProve      string
	Data         []string
	Tx           []byte
	TxId         string
	BlockHeight  int64
}

EventInfo 产生事件的结构

func (*EventInfo) ToString

func (e *EventInfo) ToString() string

ToString 转为string展示

@receiver e
@return string

type EventManager

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

EventManager 跨链触发器结构体

var EventManagerV1 *EventManager

EventManagerV1 跨链触发器

func (*EventManager) BuildCrossChainMsg

func (e *EventManager) BuildCrossChainMsg(eventInfo *EventInfo) (req *relay_chain.BeginCrossChainRequest, err error)

BuildCrossChainMsg 创建跨链信息

@receiver e
@param eventInfo
@return req
@return err

func (*EventManager) DeleteEvent

func (e *EventManager) DeleteEvent(event *common.CrossChainEvent) error

DeleteEvent 删除event

@receiver e
@param event
@return error

func (*EventManager) GetEvent

func (e *EventManager) GetEvent(crossChainEventId string) ([]*common.CrossChainEvent, error)

GetEvent 获取跨链事件

@receiver e
@param crossChainEventId
@return []*common.CrossChainEvent
@return error

func (*EventManager) SaveEvent

func (e *EventManager) SaveEvent(event *common.CrossChainEvent, isNew bool) error

SaveEvent 保存event

@receiver e
@param event
@param isNew
@return error

func (*EventManager) SetEventState

func (e *EventManager) SetEventState(crossChainEventId string, state bool, stateMessages string) error

SetEventState 设置event状态

@receiver e
@param crossChainEventId
@param state
@param stateMessages
@return error

Jump to

Keyboard shortcuts

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