backends

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: AGPL-3.0 Imports: 14 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

This section is empty.

Types

type Backend added in v0.49.0

Backend provides a subset of the FVM environment functionality Any error returned by a Backend is expected to be a `FatalError` or a `BackendError`.

type BackendStorage added in v0.49.0

type BackendStorage interface {
	environment.ValueStore
}

BackendStorage provides an interface for storage of registers

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 NewWrappedEnvironment

func NewWrappedEnvironment(env environment.Environment) *WrappedEnvironment

NewWrappedEnvironment constructs a new wrapped environment

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) BlockHash added in v0.49.0

func (we *WrappedEnvironment) BlockHash(height uint64) (gocommon.Hash, error)

BlockHash implements Backend.

func (*WrappedEnvironment) BlockProposal added in v0.49.0

func (we *WrappedEnvironment) BlockProposal() (*types.BlockProposal, error)

BlockProposal implements Backend.

func (*WrappedEnvironment) CommitBlockProposal added in v0.49.0

func (we *WrappedEnvironment) CommitBlockProposal(bp *types.BlockProposal) error

CommitBlockProposal implements Backend.

func (*WrappedEnvironment) ComputationRemaining added in v0.44.0

func (we *WrappedEnvironment) ComputationRemaining(kind common.ComputationKind) uint64

ComputationRemaining returns the remaining computation for the given kind.

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) EVMTestOperationsAllowed added in v0.48.0

func (we *WrappedEnvironment) EVMTestOperationsAllowed() bool

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) LatestBlock added in v0.49.0

func (we *WrappedEnvironment) LatestBlock() (*types.Block, error)

LatestBlock implements Backend.

func (*WrappedEnvironment) Logger added in v0.37.5

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

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

func (*WrappedEnvironment) MeteringResult added in v0.51.0

func (we *WrappedEnvironment) MeteringResult() meter.MeteringResult

MeteringResult returns the metering totals accumulated so far.

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) StageBlockProposal added in v0.49.0

func (we *WrappedEnvironment) StageBlockProposal(bp *types.BlockProposal)

StageBlockProposal implements Backend.

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) 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