cli

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 60 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLITestRunner

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

CLITestRunner provides utilities for running op-deployer CLI commands in tests

func NewCLITestRunner

func NewCLITestRunner(t *testing.T, opts ...CLITestRunnerOption) *CLITestRunner

func NewCLITestRunnerWithNetwork

func NewCLITestRunnerWithNetwork(t *testing.T, opts ...CLITestRunnerOption) *CLITestRunner

NewCLITestRunnerWithNetwork creates a new CLI test runner with default network setup. Defaults can be overridden using functional options.

func (*CLITestRunner) DeployMockSP1Verifier added in v1.20.2

func (r *CLITestRunner) DeployMockSP1Verifier(t *testing.T) common.Address

DeployMockSP1Verifier deploys MockSP1Verifier to the runner's L1. The test anvil has no release SP1 verifier, so implementations deploys must be given this one.

func (*CLITestRunner) ExpectErrorContains

func (r *CLITestRunner) ExpectErrorContains(t *testing.T, args []string, env map[string]string, contains string) string

ExpectErrorContains runs a command expecting it to fail with specific error text

func (*CLITestRunner) ExpectErrorContainsWithNetwork

func (r *CLITestRunner) ExpectErrorContainsWithNetwork(t *testing.T, args []string, env map[string]string, contains string) string

ExpectErrorContainsWithNetwork runs a command with network parameters expecting it to fail with specific error text

func (*CLITestRunner) ExpectStdoutWithNetwork added in v1.20.2

func (r *CLITestRunner) ExpectStdoutWithNetwork(t *testing.T, args []string, env map[string]string) string

ExpectStdoutWithNetwork is ExpectSuccessWithNetwork, but returns only stdout.

func (*CLITestRunner) ExpectSuccess

func (r *CLITestRunner) ExpectSuccess(t *testing.T, args []string, env map[string]string) string

ExpectSuccess runs a command expecting it to succeed

func (*CLITestRunner) ExpectSuccessWithNetwork

func (r *CLITestRunner) ExpectSuccessWithNetwork(t *testing.T, args []string, env map[string]string) string

ExpectSuccessWithNetwork runs a command with network parameters expecting it to succeed

func (*CLITestRunner) GetL1RPC

func (r *CLITestRunner) GetL1RPC() string

GetL1RPC returns the L1 RPC URL for this test runner

func (*CLITestRunner) GetPrivateKey

func (r *CLITestRunner) GetPrivateKey() string

GetPrivateKey returns the private key hex for this test runner

func (*CLITestRunner) GetWorkDir

func (r *CLITestRunner) GetWorkDir() string

GetWorkDir returns the working directory for this test runner

func (*CLITestRunner) Run

func (r *CLITestRunner) Run(ctx context.Context, args []string, env map[string]string) (string, error)

Run executes a CLI command and returns the output

func (*CLITestRunner) RunWithNetwork

func (r *CLITestRunner) RunWithNetwork(ctx context.Context, args []string, env map[string]string) (string, error)

RunWithNetwork executes a CLI command with network parameters if available

type CLITestRunnerOption

type CLITestRunnerOption func(*CLITestRunner)

CLITestRunnerOption is a functional option for configuring CLITestRunner

func WithL1RPC

func WithL1RPC(rpcURL string) CLITestRunnerOption

func WithPrivateKey

func WithPrivateKey(pkHex string) CLITestRunnerOption

Jump to

Keyboard shortcuts

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