devapp

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowOutboxCalls added in v0.12.0

func AllowOutboxCalls(ctx context.Context, network netconf.ID, backends ethbackend.Backends) error

AllowOutboxCalls allows the outbox to call the L1 vault deposit method.

func DepositedBalance added in v0.12.0

func DepositedBalance(ctx context.Context, network netconf.ID, backends ethbackend.Backends, onBehalfOf common.Address) (*big.Int, error)

DepositedBalance returns the balance of onBehalfOf in the vault.

func MaybeDeploy added in v0.12.0

func MaybeDeploy(ctx context.Context, network netconf.ID, backends ethbackend.Backends) error

MaybeDeploy deploys the mock tokens / vaults, and mints solver with mock tokens, if needed.

func RequestStatus added in v0.12.0

func RequestStatus(ctx context.Context, network netconf.ID, backends ethbackend.Backends, reqID [32]byte) (uint8, error)

RequestStatus returns the status of a request in the inbox.

func TestFlow added in v0.12.0

func TestFlow(ctx context.Context, network netconf.Network, endpoints xchain.RPCEndpoints) error

TestFlow submits deposit requests to the solve inbox and waits for them to be processed. It also includes a few invalid deposits, which should be rejected.

Types

type App

type App struct {
	L1Vault common.Address
	L1Token common.Address
	L2Token common.Address
	L1      evmchain.Metadata
	L2      evmchain.Metadata
}

func GetApp

func GetApp(network netconf.ID) (App, error)

func MustGetApp added in v0.12.0

func MustGetApp(network netconf.ID) App

func (App) Address

func (a App) Address() common.Address

func (App) ChainID

func (a App) ChainID() uint64

func (App) LogCall added in v0.12.0

func (a App) LogCall(ctx context.Context, call bindings.SolveCall) error

func (App) LogMetadata added in v0.12.0

func (a App) LogMetadata(ctx context.Context)

func (App) Name added in v0.12.0

func (App) Name() string

func (App) TokenPrereqs

func (a App) TokenPrereqs(call bindings.SolveCall) ([]bindings.SolveTokenPrereq, error)

func (App) Verify

func (a App) Verify(srcChainID uint64, call bindings.SolveCall, deposits []bindings.SolveDeposit) error

type CallOption added in v0.12.0

type CallOption func(*bindings.SolveCall)

func WithInvalidCall added in v0.12.0

func WithInvalidCall() CallOption

WithInvalidCall returns an option that sets the call target to an invalid address.

type DepositArgs

type DepositArgs struct {
	OnBehalfOf common.Address
	Amount     *big.Int
}

type DepositReq

type DepositReq struct {
	ID      stypes.ReqID   // id in inbox
	Token   common.Address // token address
	Deposit DepositArgs    // deposit args
}

func RequestDeposit added in v0.12.0

func RequestDeposit(ctx context.Context, network netconf.ID, backends ethbackend.Backends, inbox common.Address, deposit DepositArgs, opts ...CallOption) (DepositReq, error)

Jump to

Keyboard shortcuts

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