readerclient

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

This package contains auxiliary functions generated with genqlient to query the Rollups GraphQL API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToContractProof

func ConvertToContractProof(proof *Proof) *contracts.Proof

Types

type CompletionStatus

type CompletionStatus string
const (
	CompletionStatusUnprocessed                CompletionStatus = "UNPROCESSED"
	CompletionStatusAccepted                   CompletionStatus = "ACCEPTED"
	CompletionStatusRejected                   CompletionStatus = "REJECTED"
	CompletionStatusException                  CompletionStatus = "EXCEPTION"
	CompletionStatusMachineHalted              CompletionStatus = "MACHINE_HALTED"
	CompletionStatusCycleLimitExceeded         CompletionStatus = "CYCLE_LIMIT_EXCEEDED"
	CompletionStatusTimeLimitExceeded          CompletionStatus = "TIME_LIMIT_EXCEEDED"
	CompletionStatusPayloadLengthLimitExceeded CompletionStatus = "PAYLOAD_LENGTH_LIMIT_EXCEEDED"
)

type Input

type Input struct {
	// Input index starting from genesis
	Index int `json:"index"`
	// Status of the input
	Status CompletionStatus `json:"status"`
	// Address responsible for submitting the input
	MsgSender common.Address `json:"msgSender"`
	// Timestamp of the input submission, defined by the base layer's block where it was recorded
	Timestamp time.Duration `json:"timestamp"`
	// Number of the base layer block in which the input was recorded
	BlockNumber uint64 `json:"blockNumber"`
	// Input payload in Ethereum hex binary format, starting with '0x'
	Payload hexutil.Bytes `json:"payload"`
	// Notices from this particular input
	Notices []Notice `json:"notices"`
	// Vouchers from this particular input
	Vouchers []Voucher `json:"vouchers"`
	// Reports from this particular input
	Reports []Report `json:"reports"`
}

func GetInput

func GetInput(
	ctx context.Context,
	client graphql.Client,
	index int,
) (*Input, error)

GetInput returns the input at index

func GetInputs

func GetInputs(
	ctx context.Context,
	client graphql.Client,
) ([]Input, error)

GetInputs returns multiple inputs ordered by index

type Notice

type Notice struct {
	// Notice index within the context of the input that produced it
	Index int `json:"index"`
	// Input whose processing produced the notice
	InputIndex int `json:"inputIndex"`
	// Notice data as a payload in Ethereum hex binary format, starting with '0x'
	Payload hexutil.Bytes `json:"payload"`
	// Proof object that allows this notice to be validated by the base layer blockchain
	Proof *Proof `json:"proof"`
}

func GetInputNotices

func GetInputNotices(
	ctx context.Context,
	client graphql.Client,
	inputIndex int,
) ([]Notice, error)

Get multiple notices from GraphQL for the given input index.

func GetNotice

func GetNotice(
	ctx context.Context,
	client graphql.Client,
	noticeIndex int,
	inputIndex int,
) (*Notice, error)

Get notice from GraphQL given the input and notice indices.

func GetNotices

func GetNotices(
	ctx context.Context,
	client graphql.Client,
) ([]Notice, error)

Get multiple notices from graphql.

type Proof

type Proof struct {
	// Local input index within the context of the related epoch
	InputIndexWithinEpoch int `json:"inputIndexWithinEpoch"`
	// Output index within the context of the input that produced it
	OutputIndexWithinInput int `json:"outputIndexWithinInput"`
	// Merkle root of all output hashes of the related input
	// given in Ethereum hex binary format (32 bytes), starting with '0x'
	OutputHashesRootHash hexutil.Bytes `json:"outputHashesRootHash"`
	// Merkle root of all voucher hashes of the related epoch
	// given in Ethereum hex binary format (32 bytes), starting with '0x'
	VouchersEpochRootHash hexutil.Bytes `json:"vouchersEpochRootHash"`
	// Merkle root of all notice hashes of the related epoch
	// given in Ethereum hex binary format (32 bytes), starting with '0x'
	NoticesEpochRootHash hexutil.Bytes `json:"noticesEpochRootHash"`
	// Hash of the machine state claimed for the related epoch
	// given in Ethereum hex binary format (32 bytes), starting with '0x'
	MachineStateHash hexutil.Bytes `json:"machineStateHash"`
	// Proof that this output hash is in the output-hashes merkle tree.
	// This array of siblings is bottom-up ordered (from the leaf to the root).
	// Each hash is given in Ethereum hex binary format (32 bytes), starting with '0x'.
	OutputHashInOutputHashesSiblings []hexutil.Bytes `json:"outputHashInOutputHashesSiblings"`
	// Proof that this output-hashes root hash is in epoch's output merkle tree.
	// This array of siblings is bottom-up ordered (from the leaf to the root).
	// Each hash is given in Ethereum hex binary format (32 bytes), starting with '0x'.
	OutputHashesInEpochSiblings []hexutil.Bytes `json:"outputHashesInEpochSiblings"`
	// Data that allows the validity proof to be contextualized within submitted claims,
	// given as a payload in Ethereum hex binary format, starting with '0x'
	Context hexutil.Bytes `json:"context"`
}

type Report

type Report struct {
	// Report index within the context of the input that produced it
	Index int `json:"index"`
	// Input whose processing produced the report
	InputIndex int `json:"inputIndex"`
	// Report data as a payload in Ethereum hex binary format, starting with '0x'
	Payload hexutil.Bytes `json:"payload"`
}

func GetInputReports

func GetInputReports(
	ctx context.Context,
	client graphql.Client,
	inputIndex int,
) ([]Report, error)

Get multiple reports from GraphQL for the given input index.

func GetReport

func GetReport(
	ctx context.Context,
	client graphql.Client,
	reportIndex int,
	inputIndex int,
) (*Report, error)

Get report from GraphQL given the input and report indices.

func GetReports

func GetReports(
	ctx context.Context,
	client graphql.Client,
) ([]Report, error)

Get multiple reports from graphql.

type Voucher

type Voucher struct {
	// Voucher index within the context of the input that produced it
	Index int `json:"index"`
	// Input whose processing produced the voucher
	InputIndex int `json:"inputIndex"`
	// Transaction destination address in Ethereum hex binary format (20 bytes), starting with '0x'
	Destination common.Address `json:"destination"`
	// Voucher data as a payload in Ethereum hex binary format, starting with '0x'
	Payload hexutil.Bytes `json:"payload"`
	// Proof object that allows this voucher to be validated by the base layer blockchain
	Proof *Proof `json:"proof"`
}

func GetInputVouchers

func GetInputVouchers(
	ctx context.Context,
	client graphql.Client,
	inputIndex int,
) ([]Voucher, error)

Get multiple vouchers from GraphQL for the given input index.

func GetVoucher

func GetVoucher(
	ctx context.Context,
	client graphql.Client,
	voucherIndex int,
	inputIndex int,
) (*Voucher, error)

Get voucher from GraphQL given the input and voucher indices.

func GetVouchers

func GetVouchers(
	ctx context.Context,
	client graphql.Client,
) ([]Voucher, error)

Get multiple vouchers from graphql.

Jump to

Keyboard shortcuts

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