backends

package
v0.37.10-pr6434-2 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

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(
	kind common.ComputationKind,
	intensity uint,
) 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) InteractionUsed

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

InteractionUsed returns the total storage interaction used.

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(kind common.ComputationKind, intensity uint) 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) 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