types

package
v0.0.0-...-1ebabd0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

EventRecords map of transaction hashes to EthereumEvent structs

Functions

func IsEventRecorded

func IsEventRecorded(txHash string) bool

IsEventRecorded checks the sessions stored events for this transaction hash

func NewEventWrite

func NewEventWrite(txHash string, event EthereumEvent)

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

func PrintEventByTx

func PrintEventByTx(txHash string)

PrintEventByTx prints any witnessed events associated with a given transaction hash

func PrintEvents

func PrintEvents()

PrintEvents prints all the claims made on this event

Types

type CosmosMsg

type CosmosMsg struct {
	ClaimType        Event
	CosmosSender     []byte
	EthereumReceiver common.Address
	Symbol           string
	Amount           *big.Int
}

CosmosMsg contains data from MsgBurn and MsgLock events

func NewCosmosMsg

func NewCosmosMsg(claimType Event, cosmosSender []byte, ethereumReceiver common.Address, symbol string,
	amount *big.Int) CosmosMsg

NewCosmosMsg creates a new CosmosMsg

func (CosmosMsg) String

func (c CosmosMsg) String() string

String implements fmt.Stringer

type CosmosMsgAttributeKey

type CosmosMsgAttributeKey int

CosmosMsgAttributeKey enum containing supported attribute keys

const (
	// UnsupportedAttributeKey unsupported attribute key
	UnsupportedAttributeKey CosmosMsgAttributeKey = iota
	// CosmosSender sender's address on Cosmos network
	CosmosSender
	// EthereumReceiver receiver's address on Ethereum network
	EthereumReceiver
	// Amount is coin's value
	Amount
	// Symbol is the coin type
	Symbol
)

func (CosmosMsgAttributeKey) String

func (d CosmosMsgAttributeKey) String() string

String returns the event type as a string

type EthereumEvent

type EthereumEvent struct {
	EthereumChainID       *big.Int
	BridgeContractAddress common.Address
	ID                    [32]byte
	From                  common.Address
	To                    []byte
	Token                 common.Address
	Symbol                string
	Value                 *big.Int
	Nonce                 *big.Int
	ClaimType             ethbridge.ClaimType
}

EthereumEvent struct is used by LogLock and LogBurn

func (EthereumEvent) String

func (e EthereumEvent) String() string

String implements fmt.Stringer

type Event

type Event byte

Event enum containing supported chain events

const (
	// Unsupported is an invalid Cosmos or Ethereum event
	Unsupported Event = iota
	// MsgBurn is a Cosmos msg of type MsgBurn
	MsgBurn
	// MsgLock is a Cosmos msg of type MsgLock
	MsgLock
	// LogLock is for Ethereum event LogLock
	LogLock
	// LogBurn is for Ethereum event LogBurn
	LogBurn
	// LogNewProphecyClaim is an Ethereum event named 'LogNewProphecyClaim'
	LogNewProphecyClaim
)

func (Event) String

func (d Event) String() string

String returns the event type as a string

type ProphecyClaimEvent

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

ProphecyClaimEvent struct which represents a LogNewProphecyClaim event

func NewProphecyClaimEvent

func NewProphecyClaimEvent(cosmosSender []byte, symbol string, prophecyID, amount *big.Int, ethereumReceiver,
	validatorAddress, tokenAddress common.Address, claimType uint8) ProphecyClaimEvent

NewProphecyClaimEvent creates a new ProphecyClaimEvent

func (ProphecyClaimEvent) String

func (p ProphecyClaimEvent) String() string

String implements fmt.Stringer

Jump to

Keyboard shortcuts

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