Documentation
¶
Index ¶
- type AnalyzeRequest
- type AnalyzedBatchOperation
- type AnalyzedBatchOperationNode
- type AnalyzedBatchOperations
- type AnalyzedCall
- type AnalyzedCallNode
- func (a *AnalyzedCallNode) AdditionalFields() map[string]any
- func (a *AnalyzedCallNode) ContractType() string
- func (a *AnalyzedCallNode) ContractVersion() string
- func (a *AnalyzedCallNode) Data() []byte
- func (a *AnalyzedCallNode) Inputs() AnalyzedParameters
- func (a *AnalyzedCallNode) Name() string
- func (a *AnalyzedCallNode) Outputs() AnalyzedParameters
- func (a *AnalyzedCallNode) To() string
- type AnalyzedCalls
- type AnalyzedParameter
- type AnalyzedParameterNode
- type AnalyzedParameters
- type AnalyzedProposal
- type AnalyzedProposalNode
- type BaseAnalyzer
- type BatchOperationAnalyzer
- type BatchOperationAnalyzerContext
- type BatchOperationAnalyzerContextNode
- type CallAnalyzer
- type CallAnalyzerContext
- type CallAnalyzerContextNode
- type ExecutionContext
- type ExecutionContextNode
- type ParameterAnalyzer
- type ParameterAnalyzerContext
- type ParameterAnalyzerContextNode
- 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 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 (a *AnalyzedBatchOperationNode) Calls() AnalyzedCalls
func (*AnalyzedBatchOperationNode) ChainSelector ¶ added in v0.82.1
func (a *AnalyzedBatchOperationNode) ChainSelector() uint64
type AnalyzedBatchOperations ¶
type AnalyzedBatchOperations []AnalyzedBatchOperation
type AnalyzedCall ¶
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 (a *AnalyzedCallNode) Inputs() AnalyzedParameters
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 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 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 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
func (c *BatchOperationAnalyzerContextNode) 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 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 (c *CallAnalyzerContextNode) BatchOperation() decoder.DecodedBatchOperation
func (*CallAnalyzerContextNode) Proposal ¶ added in v0.83.0
func (c *CallAnalyzerContextNode) Proposal() decoder.DecodedTimelockProposal
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 (c *ExecutionContextNode) Domain() cldfdomain.Domain
func (*ExecutionContextNode) EnvironmentName ¶ added in v0.83.0
func (c *ExecutionContextNode) EnvironmentName() string
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 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 (c *ParameterAnalyzerContextNode) BatchOperation() decoder.DecodedBatchOperation
func (*ParameterAnalyzerContextNode) Call ¶ added in v0.83.0
func (c *ParameterAnalyzerContextNode) Call() decoder.DecodedCall
func (*ParameterAnalyzerContextNode) Proposal ¶ added in v0.83.0
func (c *ParameterAnalyzerContextNode) Proposal() decoder.DecodedTimelockProposal
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