Documentation ¶
Index ¶
- Constants
- func ImportNodeRuntime(store *wasmtime.Store, memory *wasmtime.Memory) (*wasmtime.Linker, error)
- type Config
- type ImportsFunc
- type Instance
- func (in *Instance) ApplyExtrinsic(data types.Extrinsic) ([]byte, error)
- func (in *Instance) BabeConfiguration() (*types.BabeConfiguration, error)
- func (in *Instance) CheckInherents()
- func (in *Instance) Exec(function string, data []byte) ([]byte, error)
- func (in *Instance) ExecuteBlock(block *types.Block) ([]byte, error)
- func (in *Instance) FinalizeBlock() (*types.Header, error)
- func (in *Instance) GenerateSessionKeys()
- func (in *Instance) GrandpaAuthorities() ([]*types.Authority, error)
- func (in *Instance) InherentExtrinsics(data []byte) ([]byte, error)
- func (in *Instance) InitializeBlock(header *types.Header) error
- func (in *Instance) Metadata() ([]byte, error)
- func (in *Instance) NetworkService() gssmrruntime.BasicNetwork
- func (in *Instance) NodeStorage() gssmrruntime.NodeStorage
- func (in *Instance) OffchainWorker()
- func (in *Instance) RandomSeed()
- func (in *Instance) SetContextStorage(s gssmrruntime.Storage)
- func (in *Instance) Stop()
- func (in *Instance) UpdateRuntimeCode(_ []byte) error
- func (in *Instance) ValidateTransaction(e types.Extrinsic) (*transaction.Validity, error)
- func (in *Instance) Version() (runtime.Version, error)
- type Memory
Constants ¶
const Name = "wasmtime"
Name represents the name of the interpreter
Variables ¶
This section is empty.
Functions ¶
func ImportNodeRuntime ¶ added in v0.3.0
func ImportNodeRuntime(store *wasmtime.Store, memory *wasmtime.Memory) (*wasmtime.Linker, error)
ImportNodeRuntime adds the imports for the v0.8 runtime to linker
Types ¶
type Config ¶
type Config struct { gssmrruntime.InstanceConfig Imports ImportsFunc }
Config represents a wasmer configuration
type ImportsFunc ¶ added in v0.3.1
type ImportsFunc func(*wasmtime.Store, *wasmtime.Memory) (*wasmtime.Linker, error)
ImportsFunc returns a linker with the module imports
func GetRuntimeImports ¶
func GetRuntimeImports(t *testing.T, targetRuntime string) ImportsFunc
GetRuntimeImports ...
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
Instance represents a v0.8 runtime go-wasmtime instance
func NewInstance ¶ added in v0.3.0
NewInstance instantiates a runtime from the given wasm bytecode
func NewInstanceFromFile ¶
NewInstanceFromFile instantiates a runtime from a .wasm file
func NewTestInstance ¶
NewTestInstance will create a new runtime instance using the given target runtime
func NewTestInstanceWithTrie ¶
func NewTestInstanceWithTrie(t *testing.T, targetRuntime string, tt *trie.Trie, lvl log.Lvl) *Instance
NewTestInstanceWithTrie will create a new runtime (polkadot/test) with the supplied trie as the storage
func (*Instance) ApplyExtrinsic ¶
ApplyExtrinsic calls runtime API function BlockBuilder_apply_extrinsic
func (*Instance) BabeConfiguration ¶
func (in *Instance) BabeConfiguration() (*types.BabeConfiguration, error)
BabeConfiguration gets the configuration data for BABE from the runtime
func (*Instance) CheckInherents ¶
func (in *Instance) CheckInherents()
func (*Instance) ExecuteBlock ¶
ExecuteBlock calls runtime function Core_execute_block
func (*Instance) FinalizeBlock ¶
FinalizeBlock calls runtime API function BlockBuilder_finalize_block
func (*Instance) GenerateSessionKeys ¶
func (in *Instance) GenerateSessionKeys()
func (*Instance) GrandpaAuthorities ¶
GrandpaAuthorities returns the genesis authorities from the runtime
func (*Instance) InherentExtrinsics ¶
InherentExtrinsics calls runtime API function BlockBuilder_inherent_extrinsics
func (*Instance) InitializeBlock ¶
InitializeBlock calls runtime API function Core_initialize_block
func (*Instance) NetworkService ¶
func (in *Instance) NetworkService() gssmrruntime.BasicNetwork
NetworkService returns the context's NetworkService
func (*Instance) NodeStorage ¶
func (in *Instance) NodeStorage() gssmrruntime.NodeStorage
NodeStorage returns the context's NodeStorage
func (*Instance) OffchainWorker ¶
func (in *Instance) OffchainWorker()
func (*Instance) RandomSeed ¶
func (in *Instance) RandomSeed()
func (*Instance) SetContextStorage ¶ added in v0.3.0
func (in *Instance) SetContextStorage(s gssmrruntime.Storage)
SetContextStorage sets the runtime context's Storage
func (*Instance) UpdateRuntimeCode ¶ added in v0.3.0
UpdateRuntimeCode ...
func (*Instance) ValidateTransaction ¶
ValidateTransaction runs the extrinsic through runtime function TaggedTransactionQueue_validate_transaction and returns *Validity