contracts

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contract

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

func (*Contract) Args added in v0.19.0

func (c *Contract) Args() []cadence.Value

func (*Contract) Code

func (c *Contract) Code() string

func (*Contract) Dependencies

func (c *Contract) Dependencies() map[string]*Contract

func (*Contract) ID

func (c *Contract) ID() int64

func (*Contract) Name

func (c *Contract) Name() string

func (*Contract) Target

func (c *Contract) Target() flow.Address

func (*Contract) TranspiledCode

func (c *Contract) TranspiledCode() string

type CyclicImportError

type CyclicImportError struct {
	Cycles [][]*Contract
}

func (*CyclicImportError) Error

func (e *CyclicImportError) Error() string

type FilesystemLoader

type FilesystemLoader struct{}

func (FilesystemLoader) Load

func (f FilesystemLoader) Load(source string) (string, error)

func (FilesystemLoader) Normalize

func (f FilesystemLoader) Normalize(base, relative string) string

type Loader

type Loader interface {
	Load(source string) (string, error)
	Normalize(base, relative string) string
}

type Preprocessor

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

func NewPreprocessor

func NewPreprocessor(loader Loader, aliases map[string]string) *Preprocessor

func (*Preprocessor) AddContractSource

func (p *Preprocessor) AddContractSource(
	contractName,
	contractSource string,
	target flow.Address,
	args []cadence.Value,
) error

func (*Preprocessor) ContractBySource

func (p *Preprocessor) ContractBySource(contractSource string) *Contract

func (*Preprocessor) ContractDeploymentOrder

func (p *Preprocessor) ContractDeploymentOrder() ([]*Contract, error)

func (*Preprocessor) ResolveImports

func (p *Preprocessor) ResolveImports() error

type Resolver added in v0.18.0

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

Resolver handles resolving imports in Cadence code

func NewResolver added in v0.18.0

func NewResolver(code []byte) (*Resolver, error)

NewResolver creates a new resolver

func (*Resolver) HasFileImports added in v0.18.0

func (r *Resolver) HasFileImports() bool

HasFileImports checks if there is a file import statement present in Cadence code

func (*Resolver) ResolveImports added in v0.18.0

func (r *Resolver) ResolveImports(
	codePath string,
	contracts []project.Contract,
	aliases project.Aliases,
) ([]byte, error)

ResolveImports resolves imports in code to addresses

resolving is done based on code file path and is resolved to addresses defined in configuration for contracts or their aliases

Jump to

Keyboard shortcuts

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