analyzer

package
v0.83.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 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 AnalyzedBatchOperationNode added in v0.82.1

type AnalyzedBatchOperationNode struct {
	annotated.BaseAnnotated
	// contains filtered or unexported fields
}

func NewAnalyzedBatchOperationNode added in v0.82.1

func NewAnalyzedBatchOperationNode(chainSelector uint64, calls AnalyzedCalls) *AnalyzedBatchOperationNode

func (*AnalyzedBatchOperationNode) Calls added in v0.82.1

func (*AnalyzedBatchOperationNode) ChainSelector added in v0.82.1

func (a *AnalyzedBatchOperationNode) ChainSelector() uint64

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 AnalyzedCallNode added in v0.82.1

type AnalyzedCallNode struct {
	annotated.BaseAnnotated
	// contains filtered or unexported fields
}

func NewAnalyzedCallNode added in v0.82.1

func NewAnalyzedCallNode(
	to,
	name string,
	inputs,
	outputs AnalyzedParameters,
	data []byte,
	contractType,
	contractVersion string,
) *AnalyzedCallNode

func (*AnalyzedCallNode) AdditionalFields added in v0.82.1

func (a *AnalyzedCallNode) AdditionalFields() map[string]any

AdditionalFields returns a copy of the call's additional metadata. It returns an empty map when no additional metadata is set.

func (*AnalyzedCallNode) ContractType added in v0.82.1

func (a *AnalyzedCallNode) ContractType() string

func (*AnalyzedCallNode) ContractVersion added in v0.82.1

func (a *AnalyzedCallNode) ContractVersion() string

func (*AnalyzedCallNode) Data added in v0.82.1

func (a *AnalyzedCallNode) Data() []byte

func (*AnalyzedCallNode) Inputs added in v0.82.1

func (*AnalyzedCallNode) Name added in v0.82.1

func (a *AnalyzedCallNode) Name() string

func (*AnalyzedCallNode) Outputs added in v0.82.1

func (a *AnalyzedCallNode) Outputs() AnalyzedParameters

func (*AnalyzedCallNode) To added in v0.82.1

func (a *AnalyzedCallNode) To() string

type AnalyzedCalls

type AnalyzedCalls []AnalyzedCall

type AnalyzedParameter

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

type AnalyzedParameterNode added in v0.82.1

type AnalyzedParameterNode struct {
	annotated.BaseAnnotated
	// contains filtered or unexported fields
}

func NewAnalyzedParameterNode added in v0.82.1

func NewAnalyzedParameterNode(name, atype string, value any) *AnalyzedParameterNode

func (*AnalyzedParameterNode) Name added in v0.82.1

func (a *AnalyzedParameterNode) Name() string

func (*AnalyzedParameterNode) Type added in v0.82.1

func (a *AnalyzedParameterNode) Type() string

func (*AnalyzedParameterNode) Value added in v0.82.1

func (a *AnalyzedParameterNode) Value() any

type AnalyzedParameters

type AnalyzedParameters []AnalyzedParameter

type AnalyzedProposal

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

type AnalyzedProposalNode added in v0.82.1

type AnalyzedProposalNode struct {
	annotated.BaseAnnotated
	// contains filtered or unexported fields
}

func NewAnalyzedProposalNode added in v0.82.1

func NewAnalyzedProposalNode(batchOps AnalyzedBatchOperations) *AnalyzedProposalNode

func (*AnalyzedProposalNode) BatchOperations added in v0.82.1

func (a *AnalyzedProposalNode) 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 BatchOperationAnalyzerContextNode added in v0.83.0

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

BatchOperationAnalyzerContextNode is the default implementation of BatchOperationAnalyzerContext.

func NewBatchOperationAnalyzerContextNode added in v0.83.0

func NewBatchOperationAnalyzerContextNode(
	proposal decoder.DecodedTimelockProposal,
) *BatchOperationAnalyzerContextNode

NewBatchOperationAnalyzerContextNode constructs a batch operation analyzer context for analyzer runs.

func (*BatchOperationAnalyzerContextNode) Proposal added in v0.83.0

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 CallAnalyzerContextNode added in v0.83.0

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

CallAnalyzerContextNode is the default implementation of CallAnalyzerContext.

func NewCallAnalyzerContextNode added in v0.83.0

func NewCallAnalyzerContextNode(
	proposal decoder.DecodedTimelockProposal,
	batchOperation decoder.DecodedBatchOperation,
) *CallAnalyzerContextNode

NewCallAnalyzerContextNode constructs a call analyzer context for analyzer runs.

func (*CallAnalyzerContextNode) BatchOperation added in v0.83.0

func (*CallAnalyzerContextNode) Proposal added in v0.83.0

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 ExecutionContextNode added in v0.83.0

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

ExecutionContextNode is the default implementation of ExecutionContext.

func NewExecutionContextNode added in v0.83.0

func NewExecutionContextNode(
	domain cldfdomain.Domain,
	environmentName string,
	blockChains chain.BlockChains,
	dataStore datastore.DataStore,
) *ExecutionContextNode

NewExecutionContextNode constructs an execution context for analyzer runs.

func (*ExecutionContextNode) BlockChains added in v0.83.0

func (c *ExecutionContextNode) BlockChains() chain.BlockChains

func (*ExecutionContextNode) DataStore added in v0.83.0

func (c *ExecutionContextNode) DataStore() datastore.DataStore

func (*ExecutionContextNode) Domain added in v0.83.0

func (*ExecutionContextNode) EnvironmentName added in v0.83.0

func (c *ExecutionContextNode) EnvironmentName() string

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 ParameterAnalyzerContextNode added in v0.83.0

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

ParameterAnalyzerContextNode is the default implementation of ParameterAnalyzerContext.

func NewParameterAnalyzerContextNode added in v0.83.0

func NewParameterAnalyzerContextNode(
	proposal decoder.DecodedTimelockProposal,
	batchOperation decoder.DecodedBatchOperation,
	call decoder.DecodedCall,
) *ParameterAnalyzerContextNode

NewParameterAnalyzerContextNode constructs a parameter analyzer context for analyzer runs.

func (*ParameterAnalyzerContextNode) BatchOperation added in v0.83.0

func (*ParameterAnalyzerContextNode) Call added in v0.83.0

func (*ParameterAnalyzerContextNode) Proposal added in v0.83.0

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