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

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