invoker

package
v0.31.9-decrease-wait-... Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithCacheSize

func WithCacheSize(size uint64) func(*Config)

WithCacheSize specifies the size of the cache the invoker uses.

Types

type Cache

type Cache interface {
	Get(key interface{}) (interface{}, bool)
	Set(key, value interface{}, cost int64) bool
}

Cache represents a key/value store to use as a cache.

type Config

type Config struct {
	CacheSize uint64
}

Config is the configuration for an invoker.

type Invoker

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

Invoker retrieves account information from and executes Cadence scripts against the Flow virtual machine.

func New

func New(index archive.Reader, options ...func(*Config)) (*Invoker, error)

New returns a new Invoker with the given configuration.

func (*Invoker) Account

func (i *Invoker) Account(height uint64, address flow.Address) (*flow.Account, error)

Account returns the account with the given address.

func (*Invoker) ByHeightFrom added in v0.31.4

func (i *Invoker) ByHeightFrom(height uint64, header *flow.Header) (*flow.Header, error)

ByHeightFrom implements the fvm/env/blocks interface

func (*Invoker) Key

func (i *Invoker) Key(height uint64, address flow.Address, index int) (*flow.AccountPublicKey, error)

Key returns the public key of the account with the given address.

func (*Invoker) Script

func (i *Invoker) Script(height uint64, script []byte, arguments []cadence.Value) (cadence.Value, error)

Script executes the given Cadence script and returns its result.

Jump to

Keyboard shortcuts

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