mockresolver

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain struct {
	ID        graphql.ID
	ChainID   hexutil.Big
	DisplayID Long
	Name      string
	LogoURL   string
}

Define the Go struct for the Chain type.

type FilterInput

type FilterInput struct {
	Key   string
	Value string
}

type Long

type Long uint64

Implements the graphql.Marshaler interface for the Long type.

func (Long) ImplementsGraphQLType

func (l Long) ImplementsGraphQLType(name string) bool

func (Long) MarshalJSON

func (l Long) MarshalJSON() ([]byte, error)

func (*Long) UnmarshalGraphQL

func (l *Long) UnmarshalGraphQL(input interface{}) error

type PageInfo

type PageInfo struct {
	HasNextPage bool
	HasPrevPage bool
	TotalPages  Long
	CurrentPage Long
}

Define the Go struct for the PageInfo type.

type QueryResolver

type QueryResolver struct {
	Chains      []Chain
	StatsResult StatsResult
	XBlocks     []XBlock
}

Define the Go struct for the Query type.

func (*QueryResolver) Stats

func (r *QueryResolver) Stats(ctx context.Context) StatsResult

func (*QueryResolver) SupportedChains

func (r *QueryResolver) SupportedChains(ctx context.Context) []Chain

Implement the supportedChains query resolver.

func (*QueryResolver) XBlock

func (r *QueryResolver) XBlock(ctx context.Context, args struct{ ChainID, Height hexutil.Big }) *XBlock

Implement the xblock query resolver.

func (*QueryResolver) Xmsgs

func (r *QueryResolver) Xmsgs(ctx context.Context, args XMsgsArgs) (XMsgConnection, error)

Implement the xmsg query resolver.

func (*QueryResolver) Xreceipt

func (r *QueryResolver) Xreceipt(ctx context.Context, args struct{ SourceChainID, DestChainID, Offset hexutil.Big }) *XReceipt

Implement the xreceipt query resolver.

type Resolver

type Resolver struct {
	QueryResolver
}

Define the root resolver.

func New

func New() *Resolver

func (*Resolver) Xmsg

func (r *Resolver) Xmsg(ctx context.Context, args struct{ SourceChainID, DestChainID, Offset hexutil.Big }) *XMsg

Implement the xmsg query resolver.

type StatsResult

type StatsResult struct {
	TotalMsgs  Long
	TopStreams []StreamStats
}

Define the Go struct for the StatsResult type.

type Status

type Status string

Define the Go struct for the Status enum type.

const (
	StatusFailed  Status = "FAILED"
	StatusPending Status = "PENDING"
	StatusSuccess Status = "SUCCESS"
)

type StreamStats

type StreamStats struct {
	SourceChain Chain
	DestChain   Chain
	MsgCount    Long
}

Define the Go struct for the StreamStats type.

type XBlock

type XBlock struct {
	ID        graphql.ID
	ChainID   hexutil.Big
	Height    hexutil.Big
	Hash      common.Hash
	Messages  []XMsg
	Timestamp graphql.Time
	URL       string
	// contains filtered or unexported fields
}

Define the Go struct for the XBlock type.

func (XBlock) Chain

func (b XBlock) Chain() (Chain, error)

type XMsg

type XMsg struct {
	ID            graphql.ID
	Block         XBlock
	To            common.Address
	ToURL         string
	DestChainID   hexutil.Big
	GasLimit      hexutil.Big
	DisplayID     string
	Offset        hexutil.Big
	Receipt       *XReceipt
	Sender        common.Address
	SenderURL     string
	SourceChainID hexutil.Big
	Status        Status
	TxHash        common.Hash
	TxURL         string
	// contains filtered or unexported fields
}

Define the Go struct for the XMsg type.

func (XMsg) DestChain

func (m XMsg) DestChain() (Chain, error)

func (XMsg) SourceChain

func (m XMsg) SourceChain() (Chain, error)

type XMsgConnection

type XMsgConnection struct {
	TotalCount Long
	Edges      []XMsgEdge
	PageInfo   PageInfo
}

Define the Go struct for the XMsgConnection type.

type XMsgEdge

type XMsgEdge struct {
	Cursor graphql.ID
	Node   XMsg
}

Define the Go struct for the XMsgEdge type.

type XMsgsArgs

type XMsgsArgs struct {
	Filters *[]FilterInput
	First   *int32
	After   *graphql.ID
	Last    *int32
	Before  *graphql.ID
}

type XReceipt

type XReceipt struct {
	ID            graphql.ID
	GasUsed       hexutil.Big
	Success       bool
	Relayer       common.Address
	SourceChainID hexutil.Big
	DestChainID   hexutil.Big
	Offset        hexutil.Big
	TxHash        common.Hash
	TxURL         string
	Timestamp     graphql.Time
	RevertReason  *string
	// contains filtered or unexported fields
}

Define the Go struct for the XReceipt type.

func (*XReceipt) DestChain

func (r *XReceipt) DestChain() (Chain, error)

func (*XReceipt) SourceChain

func (r *XReceipt) SourceChain() (Chain, error)

Jump to

Keyboard shortcuts

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