core

package
v0.0.3-rc-1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApiModuleName = "Core"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Core

type Core interface {
	Version() int64
	ExecuteBlock(dataPtr int32, dataLen int32)
	InitializeBlock(dataPtr int32, dataLen int32)
}

type Module

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

Module implements the Core Runtime API definition.

For more information about API definition, see: https://spec.polkadot.network/chap-runtime-api#sect-runtime-core-module

func New

func New(module executive.Module, decoder types.RuntimeDecoder, runtimeVersion *primitives.RuntimeVersion, mdGenerator *primitives.MetadataTypeGenerator, logger log.RuntimeLogger) Module

func (Module) ExecuteBlock

func (m Module) ExecuteBlock(dataPtr int32, dataLen int32)

ExecuteBlock executes the provided block. It takes two arguments: - dataPtr: Pointer to the data in the Wasm memory. - dataLen: Length of the data. which represent the SCALE-encoded block.

For more information about function definition, see: https://spec.polkadot.network/chap-runtime-api#sect-rte-core-execute-block

func (Module) InitializeBlock

func (m Module) InitializeBlock(dataPtr int32, dataLen int32)

InitializeBlock starts the execution of a particular block. It takes two arguments: - dataPtr: Pointer to the data in the Wasm memory. - dataLen: Length of the data. which represent the SCALE-encoded header of the block.

For more information about function definition, see: https://spec.polkadot.network/chap-runtime-api#sect-rte-core-initialize-block

func (Module) Item

func (m Module) Item() primitives.ApiItem

Item returns the first 8 bytes of the Blake2b hash of the name and version of the api module.

func (Module) Metadata

func (m Module) Metadata() primitives.RuntimeApiMetadata

Metadata returns the runtime api metadata of the module.

func (Module) Name

func (m Module) Name() string

Name returns the name of the api module.

func (Module) Version

func (m Module) Version() int64

Version returns a pointer-size SCALE-encoded Runtime version.

For more information about function definition, see: https://spec.polkadot.network/chap-runtime-api#defn-rt-core-version

Jump to

Keyboard shortcuts

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