Documentation ¶
Index ¶
- Constants
- Variables
- func NewAddDependencyDepositTx(chainID *big.Int) (*types.DepositTx, error)
- func SubscribeDepositTx(ctx context.Context, logSub LogSubscriber, depositContractAddr common.Address, ...) (ethereum.Subscription, error)
- type LogSubscriber
- type OpSimulator
- func (opSim *OpSimulator) Config() *config.ChainConfig
- func (opSim *OpSimulator) Endpoint() string
- func (opSim *OpSimulator) EthClient() *ethclient.Client
- func (opSim *OpSimulator) Start(ctx context.Context) error
- func (opSim *OpSimulator) Stop(ctx context.Context) error
- func (opSim *OpSimulator) String() string
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 ¶
View Source
var L1BlockAddress = common.HexToAddress(predeploys.L1Block)
View Source
var L1BlockInteropABI, _ = abi.JSON(strings.NewReader(bindings.L1BlockInteropMetaData.ABI))
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 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) String ¶
func (opSim *OpSimulator) String() string
Overridden such that the right endpoint is used
Click to show internal directories.
Click to hide internal directories.