model

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DESTINATION = "Destination"
View Source
const EXECUTED = "Executed"
View Source
const FALSE = "false"
View Source
const INPUT_INDEX = "InputIndex"
View Source
const NOTICE_SELECTOR = "c258d6e5"
View Source
const VOUCHER_SELECTOR = "ef615e2f"

Variables

This section is empty.

Functions

This section is empty.

Types

type AdvanceInput added in v1.3.0

type AdvanceInput struct {
	Index                  int              `db:"input_index"`
	Status                 CompletionStatus `db:"status"`
	MsgSender              common.Address   `db:"msg_sender"`
	Payload                []byte           `db:"payload"`
	BlockNumber            uint64           `db:"block_number"`
	BlockTimestamp         time.Time        `db:"block_timestamp"`
	PrevRandao             string           `db:"prev_randao"`
	AppContract            common.Address   `db:"app_contract"`
	Vouchers               []ConvenienceVoucher
	Notices                []ConvenienceNotice
	Reports                []Report
	Exception              []byte
	EspressoBlockNumber    uint64    `db:"espresso_block_number"`
	EspressoBlockTimestamp time.Time `db:"espresso_block_timestamp"`
}

Rollups advance input type.

type CompletionStatus added in v1.3.0

type CompletionStatus int

Completion status for inputs.

const (
	CompletionStatusUnprocessed CompletionStatus = iota
	CompletionStatusAccepted
	CompletionStatusRejected
	CompletionStatusException
)

type ConvenienceFilter

type ConvenienceFilter struct {
	Field *string              `json:"field,omitempty"`
	Eq    *string              `json:"eq,omitempty"`
	Ne    *string              `json:"ne,omitempty"`
	Gt    *string              `json:"gt,omitempty"`
	Gte   *string              `json:"gte,omitempty"`
	Lt    *string              `json:"lt,omitempty"`
	Lte   *string              `json:"lte,omitempty"`
	In    []*string            `json:"in,omitempty"`
	Nin   []*string            `json:"nin,omitempty"`
	And   []*ConvenienceFilter `json:"and,omitempty"`
	Or    []*ConvenienceFilter `json:"or,omitempty"`
}

type ConvenienceNotice

type ConvenienceNotice struct {
	Payload     string `db:"payload"`
	InputIndex  uint64 `db:"input_index"`
	OutputIndex uint64 `db:"output_index"`
}

type ConvenienceVoucher

type ConvenienceVoucher struct {
	Destination common.Address `db:"destination"`
	Payload     string         `db:"payload"`
	InputIndex  uint64         `db:"input_index"`
	OutputIndex uint64         `db:"output_index"`
	Executed    bool           `db:"executed"`
}

Voucher metadata type

type ConvertedInput added in v1.3.0

type ConvertedInput struct {
	MsgSender      common.Address `json:"msgSender"`
	AppContract    common.Address `json:"app_contract"`
	BlockNumber    *big.Int       `json:"blockNumber"`
	BlockTimestamp int64          `json:"blockTimestamp"`
	PrevRandao     string         `json:"prevRandao"`
	Payload        string         `json:"payload"`
}

type DecoderInterface added in v1.3.0

type DecoderInterface interface {
	HandleOutputV2(
		ctx context.Context,
		processOutputData ProcessOutputData,
	) error

	HandleInput(
		ctx context.Context,
		input InputEdge,
		status CompletionStatus,
	) error

	HandleReport(
		ctx context.Context,
		index int,
		outputIndex int,
		payload string,
	) error

	GetConvertedInput(output InputEdge) (ConvertedInput, error)

	RetrieveDestination(payload string) (common.Address, error)
}

type Input added in v1.3.0

type Input interface{}

Rollups input, which can be advance or inspect.

type InputEdge added in v1.3.0

type InputEdge struct {
	Cursor string `json:"cursor"`
	Node   struct {
		Index int    `json:"index"`
		Blob  string `json:"blob"`
	} `json:"node"`
}

type OutputEdge added in v1.3.0

type OutputEdge struct {
	Cursor string `json:"cursor"`
	Node   struct {
		Index      int    `json:"index"`
		Blob       string `json:"blob"`
		InputIndex int    `json:"inputIndex"`
	} `json:"node"`
}

type ProcessOutputData added in v1.3.0

type ProcessOutputData struct {
	OutputIndex uint64 `json:"outputIndex"`
	InputIndex  uint64 `json:"inputIndex"`
	Payload     string `json:"payload"`
	Destination string `json:"destination"`
}

type RepoSynchronizer added in v1.3.0

type RepoSynchronizer interface {
	GetDB() *sqlx.DB
	CreateTables() error
	Create(ctx context.Context, data *SynchronizerFetch) (*SynchronizerFetch, error)
	Count(ctx context.Context) (uint64, error)
	GetLastFetched(ctx context.Context) (*SynchronizerFetch, error)
}

type Report added in v1.3.0

type Report struct {
	Index      int
	InputIndex int
	Payload    []byte
}

Rollups report type.

type SynchronizerFetch

type SynchronizerFetch struct {
	Id                   int64  `db:"id"`
	TimestampAfter       uint64 `db:"timestamp_after"`
	IniCursorAfter       string `db:"ini_cursor_after"`
	LogVouchersIds       string `db:"log_vouchers_ids"`
	EndCursorAfter       string `db:"end_cursor_after"`
	IniInputCursorAfter  string `db:"ini_input_cursor_after"`
	EndInputCursorAfter  string `db:"end_input_cursor_after"`
	IniReportCursorAfter string `db:"ini_report_cursor_after"`
	EndReportCursorAfter string `db:"end_report_cursor_after"`
}

Jump to

Keyboard shortcuts

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