opsimulator

package
v0.0.0-...-b27245e Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

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

This section is empty.

Functions

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, host string, l1Chain, l2Chain config.Chain, peers map[uint64]config.Chain, interopDelay uint64) *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

Jump to

Keyboard shortcuts

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