Documentation ¶
Index ¶
- type Account
- type Contract
- type CyclicImportError
- type Deployment
- type ImportReplacer
- type LocationAliases
- type Program
- func (p *Program) AddressImportDeclarations() []*ast.ImportDeclaration
- func (p *Program) Code() []byte
- func (p *Program) CodeWithUnprocessedImports() []byte
- func (p *Program) ConvertAddressImports()
- func (p *Program) HasAddressImports() bool
- func (p *Program) HasImports() bool
- func (p *Program) Location() string
- func (p *Program) Name() (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Contract ¶
type Contract struct { Name string AccountAddress flow.Address AccountName string Args []cadence.Value // contains filtered or unexported fields }
Contract is a Cadence contract definition for a project.
func NewContract ¶
type CyclicImportError ¶
type CyclicImportError struct {
Cycles [][]*deployContract
}
CyclicImportError is returned when contract contain cyclic imports one to the other which is not possible to be resolved and deployed.
func (*CyclicImportError) Error ¶
func (e *CyclicImportError) Error() string
type Deployment ¶
type Deployment struct {
// contains filtered or unexported fields
}
Deployment contains logic to sort deployment order of contracts.
Deployment makes sure the contract containing imports is deployed after all importing contracts are deployed. This way we can deploy all contracts without missing imports. Contracts are iterated and dependency graph is built which is then later sorted
func NewDeployment ¶
func NewDeployment(contracts []*Contract, aliases LocationAliases) (*Deployment, error)
NewDeployment from the flowkit Contracts and loaded from the contract location using a loader.
func (*Deployment) Sort ¶
func (d *Deployment) Sort() ([]*Contract, error)
Sort contracts by deployment order.
Order of sorting is dependent on the possible imports contract contains, since any imported contract must be deployed before deploying the contract with that import. Only applicable to contracts.
type ImportReplacer ¶
type ImportReplacer struct {
// contains filtered or unexported fields
}
ImportReplacer implements file import replacements functionality for the project contracts with optionally included aliases.
func NewImportReplacer ¶
func NewImportReplacer(contracts []*Contract, aliases LocationAliases) *ImportReplacer
type LocationAliases ¶
LocationAliases map contract locations to fixed addresses on Flow network
type Program ¶
type Program struct {
// contains filtered or unexported fields
}
func NewProgram ¶
func (*Program) AddressImportDeclarations ¶ added in v1.12.0
func (p *Program) AddressImportDeclarations() []*ast.ImportDeclaration
func (*Program) CodeWithUnprocessedImports ¶ added in v1.12.0
func (*Program) ConvertAddressImports ¶ added in v1.12.0
func (p *Program) ConvertAddressImports()