backends

package
v0.43.1-access-memory-... Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2025 License: AGPL-3.0 Imports: 13 Imported by: 2 modules, 1 package

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 NewWrappedEnvironment

func NewWrappedEnvironment(env environment.Environment) types.Backend

NewWrappedEnvironment constructs a new wrapped environment

Types

type WrappedEnvironment

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

WrappedEnvironment wraps a FVM environment, handles external errors and provides backend to the EVM.

func (*WrappedEnvironment) AllocateSlabIndex added in v0.37.1

func (we *WrappedEnvironment) AllocateSlabIndex(owner []byte) (atree.SlabIndex, error)

AllocateSlabIndex allocates a slab index under the given account.

func (*WrappedEnvironment) ComputationAvailable

func (we *WrappedEnvironment) ComputationAvailable(usage common.ComputationUsage) bool

ComputationAvailable returns true if there is computation room for the given kind and intensity operation.

func (*WrappedEnvironment) ComputationIntensities

func (we *WrappedEnvironment) ComputationIntensities() meter.MeteredComputationIntensities

ComputationIntensities returns a the list of computation intensities

func (*WrappedEnvironment) ComputationUsed

func (we *WrappedEnvironment) ComputationUsed() (uint64, error)

ComputationUsed returns the computation used so far

func (*WrappedEnvironment) ConvertedServiceEvents

func (we *WrappedEnvironment) ConvertedServiceEvents() flow.ServiceEventList

ConvertedServiceEvents returns the converted list of emitted service events.

func (*WrappedEnvironment) EVMBlockExecuted added in v0.36.3

func (we *WrappedEnvironment) EVMBlockExecuted(
	txCount int,
	totalGasUsed uint64,
	totalSupplyInFlow float64,
)

func (*WrappedEnvironment) EVMTransactionExecuted added in v0.36.3

func (we *WrappedEnvironment) EVMTransactionExecuted(
	gasUsed uint64,
	isDirectCall bool,
	failed bool,
)

func (*WrappedEnvironment) EmitEvent

func (we *WrappedEnvironment) EmitEvent(event cadence.Event) error

EmitEvent emits an event.

func (*WrappedEnvironment) Events

func (we *WrappedEnvironment) Events() flow.EventsList

Events returns the list of emitted events.

func (*WrappedEnvironment) GenerateUUID

func (we *WrappedEnvironment) GenerateUUID() (uint64, error)

GenerateUUID generates a uuid

func (*WrappedEnvironment) GetBlockAtHeight

func (we *WrappedEnvironment) GetBlockAtHeight(height uint64) (
	runtime.Block,
	bool,
	error,
)

GetBlockAtHeight returns the block at the given height

func (*WrappedEnvironment) GetCurrentBlockHeight

func (we *WrappedEnvironment) GetCurrentBlockHeight() (uint64, error)

GetCurrentBlockHeight returns the current Flow block height

func (*WrappedEnvironment) GetValue

func (we *WrappedEnvironment) GetValue(owner, key []byte) ([]byte, error)

GetValue gets a value from the storage for the given owner and key pair, if value not found empty slice and no error is returned.

func (*WrappedEnvironment) Invoke

func (we *WrappedEnvironment) Invoke(
	spec environment.ContractFunctionSpec,
	arguments []cadence.Value,
) (
	cadence.Value,
	error,
)

Invoke invokes call inside the fvm env.

func (*WrappedEnvironment) Logger added in v0.37.5

func (we *WrappedEnvironment) Logger() zerolog.Logger

func (*WrappedEnvironment) MemoryUsed

func (we *WrappedEnvironment) MemoryUsed() (uint64, error)

MemoryUsed returns the total memory used so far.

func (*WrappedEnvironment) MeterComputation

func (we *WrappedEnvironment) MeterComputation(usage common.ComputationUsage) error

MeterComputation updates the total computation used based on the kind and intensity of the operation.

func (*WrappedEnvironment) MeterEmittedEvent

func (we *WrappedEnvironment) MeterEmittedEvent(byteSize uint64) error

MeterEmittedEvent meters a newly emitted event.

func (*WrappedEnvironment) MeterMemory

func (we *WrappedEnvironment) MeterMemory(usage common.MemoryUsage) error

MeterMemory meters the memory usage of a new operation.

func (*WrappedEnvironment) ReadRandom

func (we *WrappedEnvironment) ReadRandom(buffer []byte) error

ReadRandom sets a random number into the buffer

func (*WrappedEnvironment) Reset

func (we *WrappedEnvironment) Reset()

Reset resets and discards all the changes to the all stateful environment modules (events, storage, ...)

func (*WrappedEnvironment) RunWithMeteringDisabled added in v0.43.0

func (we *WrappedEnvironment) RunWithMeteringDisabled(f func())

func (*WrappedEnvironment) ServiceEvents

func (we *WrappedEnvironment) ServiceEvents() flow.EventsList

ServiceEvents returns the list of emitted service events

func (*WrappedEnvironment) SetNumberOfDeployedCOAs added in v0.36.3

func (we *WrappedEnvironment) SetNumberOfDeployedCOAs(count uint64)

func (*WrappedEnvironment) SetValue

func (we *WrappedEnvironment) SetValue(owner, key, value []byte) error

SetValue sets a value into the storage for the given owner and key pair.

func (*WrappedEnvironment) StartChildSpan added in v0.35.17

func (we *WrappedEnvironment) StartChildSpan(
	name trace.SpanName,
	options ...otelTrace.SpanStartOption,
) tracing.TracerSpan

StartChildSpan starts a new child open tracing span.

func (*WrappedEnvironment) TotalEmittedEventBytes

func (we *WrappedEnvironment) TotalEmittedEventBytes() uint64

TotalEmittedEventBytes returns the total byte size of events emitted so far.

func (*WrappedEnvironment) ValueExists

func (we *WrappedEnvironment) ValueExists(owner, key []byte) (bool, error)

ValueExists checks if a value exist for the given owner and key pair.

Jump to

Keyboard shortcuts

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