events

package
v0.0.0-...-268552a Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClaimTypeBurn = uint8(1)
	ClaimTypeLock = uint8(2)
)

const

Variables

View Source
var EventRecords = make(map[string]LockEvent)

EventRecords : map of transaction hashes to LockEvent structs

Functions

func NewEventWrite

func NewEventWrite(txHash string, event LockEvent)

NewEventWrite : add a validator's address to the official claims list

Types

type BurnEvent

type BurnEvent struct {
	Token               common.Address
	Symbol              string
	Amount              *big.Int
	OwnerFrom           common.Address
	TuringchainReceiver []byte
	Nonce               *big.Int
}

BurnEvent : struct which represents a BurnEvent event

func UnpackLogBurn

func UnpackLogBurn(contractAbi abi.ABI, eventName string, eventData []byte) (burnEvent *BurnEvent, err error)

UnpackLogBurn ...

type Event

type Event int

Event : enum containing supported contract events

const (
	// Unsupported : unsupported Turingchain or Ethereum event
	Unsupported Event = iota
	// MsgBurn : Turingchain event 'TuringchainMsg' type MsgBurn
	MsgBurn
	// MsgLock :  Turingchain event 'TuringchainMsg' type MsgLock
	MsgLock
	// LogLock : Ethereum event 'LockEvent'
	LogLock
	// LogTuringchainTokenBurn : Ethereum event 'LogTuringchainTokenBurn' in contract turingchainBank
	LogTuringchainTokenBurn
	// LogNewProphecyClaim : Ethereum event 'NewProphecyClaimEvent'
	LogNewProphecyClaim
)

func (Event) String

func (d Event) String() string

String : returns the event type as a string

type LockEvent

type LockEvent struct {
	From   common.Address
	To     []byte
	Token  common.Address
	Symbol string
	Value  *big.Int
	Nonce  *big.Int
}

LockEvent : struct which represents a LogLock event

func UnpackLogLock

func UnpackLogLock(contractAbi abi.ABI, eventName string, eventData []byte) (lockEvent *LockEvent, err error)

UnpackLogLock : Handles new LogLock events

type LogNewBridgeToken

type LogNewBridgeToken struct {
	Token  common.Address
	Symbol string
}

LogNewBridgeToken ...

type NewProphecyClaimEvent

type NewProphecyClaimEvent struct {
	ProphecyID        *big.Int
	ClaimType         uint8
	TuringchainSender []byte
	EthereumReceiver  common.Address
	ValidatorAddress  common.Address
	TokenAddress      common.Address
	Symbol            string
	Amount            *big.Int
}

NewProphecyClaimEvent : struct which represents a LogNewProphecyClaim event

type TuringchainMsg

type TuringchainMsg struct {
	ClaimType            Event
	TuringchainSender    []byte
	EthereumReceiver     common.Address
	TokenContractAddress common.Address
	Symbol               string
	Amount               *big.Int
}

TuringchainMsg : contains data from MsgBurn and MsgLock events

func NewTuringchainMsg

func NewTuringchainMsg(
	claimType Event,
	turingchainSender []byte,
	ethereumReceiver common.Address,
	symbol string,
	amount *big.Int,
	tokenContractAddress common.Address,
) TuringchainMsg

NewTuringchainMsg : creates a new TuringchainMsg

type TuringchainMsgAttributeKey

type TuringchainMsgAttributeKey int

TuringchainMsgAttributeKey : enum containing supported attribute keys

const (
	// UnsupportedAttributeKey : unsupported attribute key
	UnsupportedAttributeKey TuringchainMsgAttributeKey = iota
	// TuringchainSender : sender's address on Turingchain network
	TuringchainSender
	// EthereumReceiver : receiver's address on Ethereum network
	EthereumReceiver
	// Coin : coin type
	Coin
	// TokenContractAddress : coin's corresponding contract address deployed on the Ethereum network
	TokenContractAddress
)

func (TuringchainMsgAttributeKey) String

String : returns the event type as a string

Jump to

Keyboard shortcuts

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