opsimulator

package
v0.0.0-...-25dea51 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigTypeSetGasPayingToken uint8 = 0
	ConfigTypeAddDependency     uint8 = 1
	ConfigTypeRemoveDependency  uint8 = 2
)

TODO: when these are available in the monorepo import the constants directly from there L1BlockInterop contract/bindings are not available in the monorepo yet

View Source
const (

	// Invalid method parameter(s).
	InvalidParams = -32602
	// Invalid JSON was received by the server.
	// An error occurred on the server while parsing the JSON text.
	ParseErr = -32700
)

Variables

Functions

func NewAddDependencyDepositTx

func NewAddDependencyDepositTx(chainID *big.Int) (*types.DepositTx, error)

func SubscribeDepositTx

func SubscribeDepositTx(ctx context.Context, logSub LogSubscriber, depositContractAddr common.Address, ch chan<- *types.DepositTx) (ethereum.Subscription, error)

transforms Deposit event logs into DepositTx

Types

type LogSubscriber

type LogSubscriber interface {
	SubscribeFilterLogs(context.Context, ethereum.FilterQuery, chan<- types.Log) (ethereum.Subscription, error)
}

type OpSimulator

type OpSimulator struct {
	config.Chain // the chain that op-sim is wrapping
	// contains filtered or unexported fields
}

func New

func New(log log.Logger, closeApp context.CancelCauseFunc, port uint64, l1Chain, l2Chain config.Chain, peers map[uint64]config.Chain) *OpSimulator

OpSimulator wraps around the l2 chain. By embedding `Chain`, it also implements the same inteface

func (*OpSimulator) Config

func (opSim *OpSimulator) Config() *config.ChainConfig

Overridden such that the port field can appropiately be set

func (*OpSimulator) Endpoint

func (opSim *OpSimulator) Endpoint() string

Overridden such that the correct port is used

func (*OpSimulator) EthClient

func (opSim *OpSimulator) EthClient() *ethclient.Client

func (*OpSimulator) Start

func (opSim *OpSimulator) Start(ctx context.Context) error

func (*OpSimulator) Stop

func (opSim *OpSimulator) Stop(ctx context.Context) error

func (*OpSimulator) String

func (opSim *OpSimulator) String() string

Overridden such that the right endpoint is used

Jump to

Keyboard shortcuts

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