programs

package
v0.21.10 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2021 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContractUpdate

type ContractUpdate struct {
	ContractUpdateKey
	Code []byte
}

type ContractUpdateKey

type ContractUpdateKey struct {
	Address flow.Address
	Name    string
}

type ProgramEntry

type ProgramEntry struct {
	Location common.Location
	Program  *interpreter.Program
	State    *state.State
}

type ProgramGetFunc

type ProgramGetFunc func(location common.Location) (*ProgramEntry, bool)

type Programs

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

Programs is a cumulative cache-like storage for Programs helping speed up execution of Cadence Programs don't evict elements at will, like a typical cache would, but it does it only during a cleanup method, which must be called only when the Cadence execution has finished. It it also fork-aware, support cheap creation of children capturing local changes.

func NewEmptyPrograms

func NewEmptyPrograms() *Programs

func (*Programs) ChildPrograms

func (p *Programs) ChildPrograms() *Programs

func (*Programs) Cleanup

func (p *Programs) Cleanup(changedContracts []ContractUpdateKey)

func (*Programs) ForceCleanup

func (p *Programs) ForceCleanup()

ForceCleanup is used to force a complete cleanup It exists temporarily to facilitate a temporary measure which can retry a transaction in case checking fails It should be gone when the extra retry is gone

func (*Programs) Get

func (p *Programs) Get(location common.Location) (*interpreter.Program, *state.State, bool)

Get returns stored program, state which contains changes which correspond to loading this program, and boolean indicating if the value was found

func (*Programs) HasChanges

func (p *Programs) HasChanges() bool

HasChanges indicates if any changes has been introduced essentially telling if this object is identical to its parent

func (*Programs) Set

func (p *Programs) Set(location common.Location, program *interpreter.Program, state *state.State)

Jump to

Keyboard shortcuts

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