types

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagSymbolTranslatorFile = "symbol-translator-file"
	FlagRelayerDbPath        = "relayerdb-path"
)

Variables

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

EventRecords map of transaction hashes to EthereumEvent structs

Functions

func NewEventWrite

func NewEventWrite(txHash string, event EthereumEvent)

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

Types

type CosmosMsg

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

CosmosMsg contains data from MsgBurn and MsgLock events

func NewCosmosMsg

func NewCosmosMsg(claimType Event, cosmosSender []byte, cosmosSenderSequence *big.Int, ethereumReceiver common.Address, symbol string,
	amount sdk.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
	// CosmosSenderSequence sender's sequence on Cosmos network
	CosmosSenderSequence
	// EthereumReceiver receiver's address on Ethereum network
	EthereumReceiver
	// Amount is coin's value
	Amount
	// Symbol is the coin type
	Symbol
	// EthereumSender is ethereum sender address
	EthereumSender
	// EthereumSenderNonce is ethereum sender nonce
	EthereumSenderNonce
)

func (CosmosMsgAttributeKey) String

func (d CosmosMsgAttributeKey) String() string

String returns the event type as a string

type EthereumBridgeClaim

type EthereumBridgeClaim struct {
	EthereumSender common.Address
	CosmosSender   sdk.ValAddress
	Nonce          sdk.Int
}

EthereumBridgeClaim for store the EventTypeCreateClaim from cosmos

type EthereumEvent

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

EthereumEvent struct is used by LogLock and LogBurn

func (EthereumEvent) Equal

func (e EthereumEvent) Equal(other EthereumEvent) bool

Equal two events

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
	// NewProphecyClaim for newProphecyClaim method in smart contract
	NewProphecyClaim
	// CreateEthBridgeClaim is a Cosmos msg of type MsgCreateEthBridgeClaim
	CreateEthBridgeClaim
)

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           sdk.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 *big.Int, amount sdk.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

type ProphecyClaimUnique

type ProphecyClaimUnique struct {
	CosmosSenderSequence *big.Int
	CosmosSender         []byte
}

ProphecyClaimUnique for data part of ProphecyClaim transaction in Ethereum

Jump to

Keyboard shortcuts

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