blockbuilder

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: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApiModuleName = "BlockBuilder"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockBuilder

type BlockBuilder interface {
	ApplyExtrinsic(dataPtr int32, dataLen int32) int64
	FinalizeBlock() int64
	InherentExtrinsics(dataPtr int32, dataLen int32) int64
	CheckInherents(dataPtr int32, dataLen int32) int64
}

type Module

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

Module implements the BlockBuilder Runtime API definition.

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

func New

func New(runtimeExtrinsic extrinsic.RuntimeExtrinsic, executive executive.Module, decoder types.RuntimeDecoder, mdGenerator *primitives.MetadataTypeGenerator, logger log.RuntimeLogger) Module

func (Module) ApplyExtrinsic

func (m Module) ApplyExtrinsic(dataPtr int32, dataLen int32) int64

ApplyExtrinsic applies an extrinsic to 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 unchecked extrinsic. Returns a pointer-size of the SCALE-encoded result, which specifies if this extrinsic is included in this block or not.

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

func (Module) CheckInherents

func (m Module) CheckInherents(dataPtr int32, dataLen int32) int64

CheckInherents checks the inherents are valid. It takes two arguments: - dataPtr: Pointer to the data in the Wasm memory. - dataLen: Length of the data. which represent the SCALE-encoded inherent data. Returns a pointer-size of the SCALE-encoded result, specifying if all inherents are valid.

For more information about function definition, see: https://spec.polkadot.network/chap-runtime-api#id-blockbuilder_check_inherents

func (Module) FinalizeBlock

func (m Module) FinalizeBlock() int64

FinalizeBlock finalizes the state changes for the current block. Returns a pointer-size of the SCALE-encoded header for this block.

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

func (Module) InherentExtrinsics

func (m Module) InherentExtrinsics(dataPtr int32, dataLen int32) int64

InherentExtrinsics generates inherent extrinsics. Inherent data varies depending on chain configuration. It takes two arguments: - dataPtr: Pointer to the data in the Wasm memory. - dataLen: Length of the data. which represent the SCALE-encoded inherent data. Returns a pointer-size of the SCALE-encoded timestamp extrinsic.

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

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.

Jump to

Keyboard shortcuts

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