Documentation
¶
Index ¶
- type AnalyzeRequest
- type AnalyzedBatchOperation
- type AnalyzedBatchOperations
- type AnalyzedCall
- type AnalyzedCalls
- type AnalyzedParameter
- type AnalyzedParameters
- type AnalyzedProposal
- type BaseAnalyzer
- type BatchOperationAnalyzer
- type BatchOperationAnalyzerContext
- type CallAnalyzer
- type CallAnalyzerContext
- type ExecutionContext
- type ParameterAnalyzer
- type ParameterAnalyzerContext
- type ProposalAnalyzeRequest
- type ProposalAnalyzer
- type Registry
- func (r *Registry) All() []BaseAnalyzer
- func (r *Registry) BatchOperationAnalyzers() []BatchOperationAnalyzer
- func (r *Registry) CallAnalyzers() []CallAnalyzer
- func (r *Registry) Get(id string) (BaseAnalyzer, bool)
- func (r *Registry) List() []string
- func (r *Registry) ParameterAnalyzers() []ParameterAnalyzer
- func (r *Registry) ProposalAnalyzers() []ProposalAnalyzer
- func (r *Registry) Register(baseAnalyzer BaseAnalyzer) error
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 AnalyzedCalls ¶
type AnalyzedCalls []AnalyzedCall
type AnalyzedParameter ¶
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 BatchOperationAnalyzer ¶
type BatchOperationAnalyzer interface {
BaseAnalyzer
CanAnalyze(ctx context.Context, req AnalyzeRequest[BatchOperationAnalyzerContext], operation decoder.DecodedBatchOperation) bool
Analyze(ctx context.Context, req AnalyzeRequest[BatchOperationAnalyzerContext], operation decoder.DecodedBatchOperation) (annotation.Annotations, error)
}
type BatchOperationAnalyzerContext ¶
type BatchOperationAnalyzerContext interface {
// Proposal returns the current proposal-level context.
Proposal() decoder.DecodedTimelockProposal
}
type CallAnalyzer ¶
type CallAnalyzer interface {
BaseAnalyzer
CanAnalyze(ctx context.Context, req AnalyzeRequest[CallAnalyzerContext], call decoder.DecodedCall) bool
Analyze(ctx context.Context, req AnalyzeRequest[CallAnalyzerContext], call decoder.DecodedCall) (annotation.Annotations, error)
}
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 ParameterAnalyzer ¶
type ParameterAnalyzer interface {
BaseAnalyzer
CanAnalyze(ctx context.Context, req AnalyzeRequest[ParameterAnalyzerContext], param decoder.DecodedParameter) bool
Analyze(ctx context.Context, req AnalyzeRequest[ParameterAnalyzerContext], param decoder.DecodedParameter) (annotation.Annotations, error)
}
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 ProposalAnalyzer ¶
type ProposalAnalyzer interface {
BaseAnalyzer
CanAnalyze(ctx context.Context, req ProposalAnalyzeRequest, proposal decoder.DecodedTimelockProposal) bool
Analyze(ctx context.Context, req ProposalAnalyzeRequest, proposal decoder.DecodedTimelockProposal) (annotation.Annotations, error)
}
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages analyzer registration and lookup.
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) 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