chain

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientFunc

type ClientFunc func(cfg *config.ChainConfig) IClient

type CollectorResponse

type CollectorResponse struct {
	Message string `json:"message"`
}

CollectorResponse is a struct that represent the response sent by collector on ok

type HashFunc

type HashFunc func(sp *ScreenedPacket) string

type IClient

type IClient interface {
	// Name gives the name of the client
	Name() string
	// FeedPacket fetches the packet from the source chain and sends it to the channel `ch`
	FeedPacket(ctx context.Context, ch chan<- *Packet)
	// GetMissedPacket queries the db-service for information about the packet the attestor
	// node has to reverify and resign
	GetMissedPacket(
		ctx context.Context, missedPkt *MissedPacket) (
		*Packet, error)
	SetMetrics(metrics *metrics.PrometheusMetrics)
}

type Message

type Message struct {
	DestTokenAddress string   `json:"dest_token_address"`
	SenderAddress    string   `json:"sender_address"`
	Amount           *big.Int `json:"amount"`
	ReceiverAddress  string   `json:"receiver_address"`
}

func (Message) String

func (m Message) String() string

type MissedPacket

type MissedPacket struct {
	TargetChainID *big.Int `json:"destChainId"`
	SourceChainID *big.Int `json:"sourceChainId"`
	SeqNum        uint64   `json:"sequence"`
	Height        uint64   `json:"height"`
	TxnID         string   `json:"transactionHash"`
}

MissedPacket denotes the information about a packet that db-service administrator has requested for the attestors to re-process

func (*MissedPacket) UnmarshalJSON

func (packet *MissedPacket) UnmarshalJSON(data []byte) error

Custom unmarshal function to convert a JSON string into a *big.Int

type MissedPacketDetails

type MissedPacketDetails struct {
	Data    []*MissedPacket `json:"data"`
	Message string          `json:"message"`
}

MissedPacketDetails represents the structure sent by the db-service during polling.

type NetworkAddress

type NetworkAddress struct {
	ChainID *big.Int `json:"chain_id"`
	Address string   `json:"address"`
}

func (NetworkAddress) String

func (n NetworkAddress) String() string

type Packet

type Packet struct {
	Version     uint8          `json:"version"`
	Source      NetworkAddress `json:"source"`
	Destination NetworkAddress `json:"destination"`
	Sequence    uint64         `json:"sequence"`
	Message     Message        `json:"message"`
	Height      uint64         `json:"height"`
	// contains filtered or unexported fields
}

Packet denotes the common structure for all the Outgoing and Incoming packets in the bridge

func (*Packet) GetSha256Hash

func (p *Packet) GetSha256Hash() string

func (*Packet) IsMissed

func (p *Packet) IsMissed() bool

func (*Packet) SetMissed

func (p *Packet) SetMissed(isMissed bool)

type ScreenedPacket

type ScreenedPacket struct {
	Packet  *Packet `json:"packet"`
	IsWhite bool    `json:"is_white"`
}

ScreenedPacket is a struct to denote if a packet has been flagged by the wallet screening service; IsWhite: true denotes the packet has been white flagged

Directories

Path Synopsis
rpc
abi

Jump to

Keyboard shortcuts

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