Documentation
¶
Index ¶
- type AnalysisResult
- type Analyzer
- func (a *Analyzer) AnalyzeDirectory(dirPath string) error
- func (a *Analyzer) AnalyzeFile(filePath string) (*AnalysisResult, error)
- func (a *Analyzer) FetchContractFromChain(contractName string, network string) error
- func (a *Analyzer) FetchContractFromChainSelective(contractName string, network string, structNames map[string]bool) error
- func (a *Analyzer) GetReport() *Report
- func (a *Analyzer) ResolveNestedTypes(network string) error
- func (a *Analyzer) SetIncludeBase64(include bool)
- type Field
- type Import
- type Parameter
- type Report
- type SimpleMemoryGauge
- type Struct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnalysisResult ¶
type AnalysisResult struct {
FileName string `json:"fileName"`
Type string `json:"type"`
Parameters []Parameter `json:"parameters"`
ReturnType string `json:"returnType,omitempty"`
Imports []Import `json:"imports"`
Base64 string `json:"base64,omitempty"`
Tag string `json:"tag,omitempty"`
}
AnalysisResult represents the analysis result of a single Cadence file
type Analyzer ¶
type Analyzer struct {
Transactions map[string]AnalysisResult
Scripts map[string]AnalysisResult
Structs map[string]Struct
IncludeBase64 bool
AddressesPath string // New field for storing addresses.json path
}
Analyzer is responsible for analyzing Cadence files
func (*Analyzer) AnalyzeDirectory ¶
AnalyzeDirectory analyzes all Cadence files in a directory and its subdirectories
func (*Analyzer) AnalyzeFile ¶
func (a *Analyzer) AnalyzeFile(filePath string) (*AnalysisResult, error)
AnalyzeFile analyzes a single Cadence file and returns its analysis result
func (*Analyzer) FetchContractFromChain ¶ added in v0.0.3
FetchContractFromChain fetches contract code from Flow blockchain and analyzes its structures
func (*Analyzer) FetchContractFromChainSelective ¶ added in v0.0.3
func (a *Analyzer) FetchContractFromChainSelective(contractName string, network string, structNames map[string]bool) error
FetchContractFromChainSelective fetches contract code and analyzes only specific structures
func (*Analyzer) ResolveNestedTypes ¶ added in v0.0.3
ResolveNestedTypes resolves nested type references by fetching contracts from chain
func (*Analyzer) SetIncludeBase64 ¶
SetIncludeBase64 sets whether to include base64-encoded content in the analysis results
type Field ¶
type Field struct {
Name string `json:"name"`
TypeStr string `json:"typeStr"`
Optional bool `json:"optional"`
Access string `json:"access"`
}
Field represents a field in a struct
type Parameter ¶
type Parameter struct {
Name string `json:"name"`
TypeStr string `json:"typeStr"`
Optional bool `json:"optional"`
}
Parameter represents a single parameter in a Cadence transaction or script
type Report ¶
type Report struct {
Transactions map[string]AnalysisResult `json:"transactions"`
Scripts map[string]AnalysisResult `json:"scripts"`
Structs map[string]Struct `json:"structs"`
Addresses map[string]interface{} `json:"addresses,omitempty"`
IncludeBase64 bool `json:"-"`
}
Report represents the complete analysis report
type SimpleMemoryGauge ¶
type SimpleMemoryGauge struct{}
SimpleMemoryGauge implements common.MemoryGauge
func (*SimpleMemoryGauge) MeterMemory ¶
func (g *SimpleMemoryGauge) MeterMemory(size common.MemoryUsage) error