Documentation
¶
Index ¶
- func BlockRandomSourceDeclaration(fvmEnv environment.Environment) stdlib.StandardLibraryValue
- func DefaultRuntimeParams(chain flow.Chain) environment.RuntimeParams
- func EVMInternalEVMContractValue(chainID flow.ChainID, fvmEnv environment.Environment) *interpreter.SimpleCompositeValue
- func TransactionIndexDeclaration(fvmEnv environment.Environment) stdlib.StandardLibraryValue
- type CadenceRuntimeConstructor
- type ReusableCadenceRuntimePool
- type SwappableEnvironment
- type WrappedCadenceExecutor
- type WrappedCadenceRuntime
- func (wr WrappedCadenceRuntime) ExecuteScript(s runtime.Script, c runtime.Context) (cadence.Value, error)
- func (wr WrappedCadenceRuntime) ExecuteTransaction(s runtime.Script, c runtime.Context) error
- func (wr WrappedCadenceRuntime) InvokeContractFunction(contractLocation common.AddressLocation, functionName string, ...) (cadence.Value, error)
- func (wr WrappedCadenceRuntime) NewContractFunctionExecutor(contractLocation common.AddressLocation, functionName string, ...) runtime.Executor
- func (wr WrappedCadenceRuntime) NewScriptExecutor(s runtime.Script, c runtime.Context) runtime.Executor
- func (wr WrappedCadenceRuntime) NewTransactionExecutor(s runtime.Script, c runtime.Context) runtime.Executor
- func (wr WrappedCadenceRuntime) ParseAndCheckProgram(source []byte, context runtime.Context) (*interpreter.Program, error)
- func (wr WrappedCadenceRuntime) ReadStored(address common.Address, path cadence.Path, context runtime.Context) (cadence.Value, error)
- func (wr WrappedCadenceRuntime) Storage(context runtime.Context) (*runtime.Storage, *interpreter.Interpreter, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlockRandomSourceDeclaration ¶ added in v0.45.0
func BlockRandomSourceDeclaration(fvmEnv environment.Environment) stdlib.StandardLibraryValue
BlockRandomSourceDeclaration returns a declaration for the `randomSource` function. if the environment is a SwappableEnvironment the underlying environment can be swapped without causing issues.
func DefaultRuntimeParams ¶ added in v0.45.0
func DefaultRuntimeParams(chain flow.Chain) environment.RuntimeParams
func EVMInternalEVMContractValue ¶ added in v0.45.0
func EVMInternalEVMContractValue(chainID flow.ChainID, fvmEnv environment.Environment) *interpreter.SimpleCompositeValue
EVMInternalEVMContractValue creates an internal EVM contract value based on the specified ChainID and environment. if the environment is a SwappableEnvironment the underlying environment can be swapped without causing issues.
func TransactionIndexDeclaration ¶ added in v0.45.0
func TransactionIndexDeclaration(fvmEnv environment.Environment) stdlib.StandardLibraryValue
TransactionIndexDeclaration returns a declaration for the `getTransactionIndex` function. if the environment is a SwappableEnvironment the underlying environment can be swapped without causing issues.
Types ¶
type CadenceRuntimeConstructor ¶ added in v0.30.0
type ReusableCadenceRuntimePool ¶
type ReusableCadenceRuntimePool struct {
// contains filtered or unexported fields
}
func NewCustomReusableCadenceRuntimePool ¶
func NewCustomReusableCadenceRuntimePool( poolSize int, chain flow.Chain, config runtime.Config, newCustomRuntime CadenceRuntimeConstructor, ) ReusableCadenceRuntimePool
func (ReusableCadenceRuntimePool) Borrow ¶
func (pool ReusableCadenceRuntimePool) Borrow( fvmEnv environment.Environment, runtimeType environment.CadenceRuntimeType, ) environment.ReusableCadenceRuntime
func (ReusableCadenceRuntimePool) Return ¶
func (pool ReusableCadenceRuntimePool) Return( reusable environment.ReusableCadenceRuntime, )
type SwappableEnvironment ¶ added in v0.45.0
type SwappableEnvironment struct {
environment.Environment
}
SwappableEnvironment is a wrapper type that extends the functionality of environment.Environment. It is designed to allow dynamic replacement of the underlying environment implementation.
type WrappedCadenceExecutor ¶
func (WrappedCadenceExecutor) Execute ¶
func (we WrappedCadenceExecutor) Execute() error
func (WrappedCadenceExecutor) Preprocess ¶
func (we WrappedCadenceExecutor) Preprocess() error
type WrappedCadenceRuntime ¶
WrappedCadenceRuntime wraps cadence runtime to handle errors. Errors from cadence runtime should be handled with `errors.HandleRuntimeError` before the FVM can understand them. Handling all possible locations, where the error could be coming from, here, makes it impossible to forget to handle the error.
func (WrappedCadenceRuntime) ExecuteScript ¶
func (WrappedCadenceRuntime) ExecuteTransaction ¶
func (WrappedCadenceRuntime) InvokeContractFunction ¶
func (WrappedCadenceRuntime) NewContractFunctionExecutor ¶
func (WrappedCadenceRuntime) NewScriptExecutor ¶
func (WrappedCadenceRuntime) NewTransactionExecutor ¶
func (WrappedCadenceRuntime) ParseAndCheckProgram ¶
func (wr WrappedCadenceRuntime) ParseAndCheckProgram(source []byte, context runtime.Context) (*interpreter.Program, error)
func (WrappedCadenceRuntime) ReadStored ¶
func (WrappedCadenceRuntime) Storage ¶
func (wr WrappedCadenceRuntime) Storage(context runtime.Context) (*runtime.Storage, *interpreter.Interpreter, error)