project

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account interface {
	Name() string
	Address() flow.Address
}

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

func NewContract(
	name string,
	location string,
	code []byte,
	accountAddress flow.Address,
	accountName string,
	args []cadence.Value,
) *Contract

func (*Contract) Code

func (c *Contract) Code() []byte

func (*Contract) Location

func (c *Contract) Location() string

func (*Contract) SetCode

func (c *Contract) SetCode(code []byte)

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

func (*ImportReplacer) Replace

func (i *ImportReplacer) Replace(program *Program) (*Program, error)

type LocationAliases

type LocationAliases map[string]string

LocationAliases map contract locations to fixed addresses on Flow network

type Program

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

func NewProgram

func NewProgram(code []byte, args []cadence.Value, location string) (*Program, error)

func (*Program) AddressImportDeclarations added in v1.12.0

func (p *Program) AddressImportDeclarations() []*ast.ImportDeclaration

func (*Program) Code

func (p *Program) Code() []byte

func (*Program) CodeWithUnprocessedImports added in v1.12.0

func (p *Program) CodeWithUnprocessedImports() []byte

func (*Program) ConvertAddressImports added in v1.12.0

func (p *Program) ConvertAddressImports()

func (*Program) HasAddressImports added in v1.12.0

func (p *Program) HasAddressImports() bool

func (*Program) HasImports

func (p *Program) HasImports() bool

func (*Program) Location

func (p *Program) Location() string

func (*Program) Name

func (p *Program) Name() (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL