forge

package
v0.0.0-...-c5d5e9c Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ForgeAdapter

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

ForgeAdapter handles Forge command execution with streaming output

func NewForgeAdapter

func NewForgeAdapter(projectRoot string, log *slog.Logger) *ForgeAdapter

NewForgeAdapter creates a new forge executor

func (*ForgeAdapter) Build

func (f *ForgeAdapter) Build() error

Build runs forge build with proper output handling

func (*ForgeAdapter) RunCastTrace

func (f *ForgeAdapter) RunCastTrace(ctx context.Context, rpcURL string, txHash string) ([]byte, error)

RunCastTrace runs `cast run` to trace a transaction and returns the JSON output

func (*ForgeAdapter) RunScript

func (f *ForgeAdapter) RunScript(ctx context.Context, config usecase.RunScriptConfig) (*forge.RunResult, error)

Run executes a Foundry script with the given options

type HydratedRunResult

type HydratedRunResult forge.HydratedRunResult

func (*HydratedRunResult) GetDeploymentByAddress

func (r *HydratedRunResult) GetDeploymentByAddress(address common.Address) *forge.Deployment

GetDeploymentByAddress returns the deployment record for a given address

func (*HydratedRunResult) GetProxiesForImplementation

func (r *HydratedRunResult) GetProxiesForImplementation(implAddress common.Address) []*forge.ProxyRelationship

GetProxiesForImplementation returns all proxies pointing to an implementation

func (*HydratedRunResult) GetProxyInfo

func (r *HydratedRunResult) GetProxyInfo(address common.Address) (*forge.ProxyInfo, bool)

GetProxyInfo returns proxy info for an address if it's a proxy

func (*HydratedRunResult) GetTransactionByID

func (r *HydratedRunResult) GetTransactionByID(txID [32]byte) *forge.Transaction

GetTransactionByID returns a transaction by its ID

type OutputProcessor

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

OutputProcessor handles real-time output processing

func NewOutputProcessor

func NewOutputProcessor(debugDir string) *OutputProcessor

NewOutputProcessor creates a new output processor

func (*OutputProcessor) ProcessOutput

func (op *OutputProcessor) ProcessOutput(reader io.Reader, entityChan chan<- ParsedEntity) error

ProcessOutput processes output in real-time, returning parsed entities via channel

type ParsedEntity

type ParsedEntity struct {
	Type    string
	Data    any
	RawLine string
	Stage   Stage
}

ParsedEntity represents different types of parsed output

type RunResultHydrator

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

RunResultHydrator is our new clean implementation of the execution parser

func NewRunResultHydrator

func NewRunResultHydrator(projectRoot string, parser usecase.ABIParser, indexer usecase.ContractRepository, log *slog.Logger) (*RunResultHydrator, error)

NewRunResultHydrator creates a new internal parser

func (*RunResultHydrator) Hydrate

func (h *RunResultHydrator) Hydrate(
	ctx context.Context,
	runResult *forge.RunResult,
) (*forge.HydratedRunResult, error)

ParseExecution parses the script output into a structured execution result

type Stage

type Stage string
const (
	StageSimulating   Stage = "Simulating"
	StageBroadcasting Stage = "Broadcasting"
	StageCompleted    Stage = "Completed"
)

type StageInfo

type StageInfo struct {
	Stage     Stage
	StartTime time.Time
	EndTime   time.Time
	Completed bool
	Skipped   bool
	Lines     int
}

StageInfo tracks information about each stage

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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