shared

package
v1.16.7 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddrFor

func AddrFor(t *testing.T, dk *devkeys.MnemonicDevKeys, key devkeys.Key) common.Address

AddrFor generates an address for a given role

func DefaultPrivkey

func DefaultPrivkey(t *testing.T) (string, *ecdsa.PrivateKey, *devkeys.MnemonicDevKeys)

DefaultPrivkey returns the default private key for testing

func DeployDummyCaller added in v1.16.7

func DeployDummyCaller(t *testing.T, rpcClient *rpc.Client, afactsFS foundry.StatDirFs, prank, opcmAddr common.Address)

DeployDummyCaller deploys DummyCaller at the prank address with the given OPCM address.

func NewChainIntent

func NewChainIntent(t *testing.T, dk *devkeys.MnemonicDevKeys, l1ChainID *big.Int, l2ChainID *uint256.Int, gasLimit uint64) *state.ChainIntent

func NewIntent

func NewIntent(
	t *testing.T,
	l1ChainID *big.Int,
	dk *devkeys.MnemonicDevKeys,
	l2ChainID *uint256.Int,
	l1Loc *artifacts.Locator,
	l2Loc *artifacts.Locator,
	gasLimit uint64,
) (*state.Intent, *state.State)

func RunPastUpgrades added in v1.16.7

func RunPastUpgrades(t *testing.T, host *script.Host, chainID uint64, prank common.Address, systemConfigProxy common.Address)

RunPastUpgrades executes all past OPCM upgrades in-memory only (no broadcast). It fetches OPCM addresses from the superchain-registry, queries their actual versions on-chain, and applies upgrades in version order, skipping any that have already been applied.

func RunPastUpgradesWithRPC added in v1.16.7

func RunPastUpgradesWithRPC(t *testing.T, l1RPCUrl string, afactsFS foundry.StatDirFs, lgr log.Logger, chainID uint64, prank common.Address, systemConfigProxy common.Address)

RunPastUpgradesWithRPC runs past upgrades and broadcasts them using Anvil impersonation. It fetches OPCM data from the superchain-registry and applies upgrades in version order, skipping any upgrades that have already been applied based on SystemConfig.lastUsedOPCMVersion().

Types

type ContractCaller added in v1.16.7

type ContractCaller interface {
	Call(to common.Address, data []byte) ([]byte, error)
}

ContractCaller abstracts contract calls for both script.Host and ethclient.Client

type HostCaller added in v1.16.7

type HostCaller struct {
	Host *script.Host
}

HostCaller adapts script.Host to ContractCaller

func (*HostCaller) Call added in v1.16.7

func (h *HostCaller) Call(to common.Address, data []byte) ([]byte, error)

type ImpersonationBroadcaster added in v1.16.7

type ImpersonationBroadcaster struct {
	// contains filtered or unexported fields
}

ImpersonationBroadcaster broadcasts transactions using Anvil impersonation.

func NewImpersonationBroadcaster added in v1.16.7

func NewImpersonationBroadcaster(lgr log.Logger, client *ethclient.Client, rpcClient *rpc.Client, from common.Address, chainID *big.Int) *ImpersonationBroadcaster

func (*ImpersonationBroadcaster) Broadcast added in v1.16.7

func (*ImpersonationBroadcaster) Hook added in v1.16.7

func (b *ImpersonationBroadcaster) Hook(bcast script.Broadcast)

type RPCCaller added in v1.16.7

type RPCCaller struct {
	Ctx    context.Context
	Client *ethclient.Client
}

RPCCaller adapts ethclient.Client to ContractCaller

func (*RPCCaller) Call added in v1.16.7

func (r *RPCCaller) Call(to common.Address, data []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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