analyzer

package
v0.81.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 11 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 AnalyzeRequest

type AnalyzeRequest[T any] struct {
	AnalyzerContext           T
	ExecutionContext          ExecutionContext
	DependencyAnnotationStore annotationstore.DependencyAnnotationStore
}

AnalyzeRequest encapsulates the analyzer context, execution context, and annotation store passed to analyzer.

type AnalyzedBatchOperation

type AnalyzedBatchOperation interface {
	annotated.Annotated
	ChainSelector() uint64
	Calls() AnalyzedCalls
}

type AnalyzedBatchOperations

type AnalyzedBatchOperations []AnalyzedBatchOperation

type AnalyzedCall

type AnalyzedCall interface {
	annotated.Annotated
	To() string
	Name() string
	Inputs() AnalyzedParameters
	Outputs() AnalyzedParameters
	Data() []byte
	ContractType() string
	ContractVersion() string
	AdditionalFields() map[string]any
}

type AnalyzedCalls

type AnalyzedCalls []AnalyzedCall

type AnalyzedParameter

type AnalyzedParameter interface {
	annotated.Annotated
	Name() string
	Type() string
	Value() any
}

type AnalyzedParameters

type AnalyzedParameters []AnalyzedParameter

type AnalyzedProposal

type AnalyzedProposal interface {
	annotated.Annotated
	BatchOperations() AnalyzedBatchOperations
}

type BaseAnalyzer

type BaseAnalyzer interface {
	ID() string
	// Dependencies returns the IDs of analyzers that must run before this analyzer.
	//
	// The returned strings MUST correspond to the ID() values of other registered analyzers.
	// Implementations MUST NOT introduce circular dependencies (directly or indirectly).
	// The engine uses this list to:
	//   - schedule analyzers in dependency order
	//   - scope AnnotationStore reads to only these dependency IDs
	Dependencies() []string
}

type BatchOperationAnalyzerContext

type BatchOperationAnalyzerContext interface {
	// Proposal returns the current proposal-level context.
	Proposal() decoder.DecodedTimelockProposal
}

type CallAnalyzerContext

type CallAnalyzerContext interface {
	// Proposal returns the current proposal-level context.
	Proposal() decoder.DecodedTimelockProposal
	// BatchOperation returns the current batch operation context.
	BatchOperation() decoder.DecodedBatchOperation
}

type ExecutionContext

type ExecutionContext interface {
	Domain() cldfdomain.Domain
	EnvironmentName() string
	BlockChains() chain.BlockChains
	DataStore() datastore.DataStore
}

ExecutionContext encapsulates the execution context passed to an analyzer.

type ParameterAnalyzerContext

type ParameterAnalyzerContext interface {
	// Proposal returns the current proposal-level context.
	Proposal() decoder.DecodedTimelockProposal
	// BatchOperation returns the current batch operation context.
	BatchOperation() decoder.DecodedBatchOperation
	// Call returns the current call-level context.
	Call() decoder.DecodedCall
}

type ProposalAnalyzeRequest

type ProposalAnalyzeRequest struct {
	ExecutionContext          ExecutionContext
	DependencyAnnotationStore annotationstore.DependencyAnnotationStore
}

ProposalAnalyzeRequest encapsulates the execution context and annotation store passed to a proposal analyzer.

type Registry

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

Registry manages analyzer registration and lookup.

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new analyzer registry.

func (*Registry) All

func (r *Registry) All() []BaseAnalyzer

All returns all registered analyzers in deterministic ID order.

func (*Registry) BatchOperationAnalyzers

func (r *Registry) BatchOperationAnalyzers() []BatchOperationAnalyzer

BatchOperationAnalyzers returns registered batch operation analyzers.

func (*Registry) CallAnalyzers

func (r *Registry) CallAnalyzers() []CallAnalyzer

CallAnalyzers returns registered call analyzers.

func (*Registry) Get

func (r *Registry) Get(id string) (BaseAnalyzer, bool)

Get retrieves an analyzer by ID.

func (*Registry) List

func (r *Registry) List() []string

List returns all registered analyzer IDs.

func (*Registry) ParameterAnalyzers

func (r *Registry) ParameterAnalyzers() []ParameterAnalyzer

ParameterAnalyzers returns registered parameter analyzers.

func (*Registry) ProposalAnalyzers

func (r *Registry) ProposalAnalyzers() []ProposalAnalyzer

ProposalAnalyzers returns registered proposal analyzers.

func (*Registry) Register

func (r *Registry) Register(baseAnalyzer BaseAnalyzer) error

Register adds an analyzer to the registry. Returns an error if: - analyzer is nil - analyzer ID is empty - an analyzer with the same ID is already registered - analyzer type is unsupported

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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