Documentation
¶
Index ¶
- Constants
- type BlockBuilder
- type Module
- func (m Module) ApplyExtrinsic(dataPtr int32, dataLen int32) int64
- func (m Module) CheckInherents(dataPtr int32, dataLen int32) int64
- func (m Module) FinalizeBlock() int64
- func (m Module) InherentExtrinsics(dataPtr int32, dataLen int32) int64
- func (m Module) Item() primitives.ApiItem
- func (m Module) Metadata() primitives.RuntimeApiMetadata
- func (m Module) Name() string
Constants ¶
const (
ApiModuleName = "BlockBuilder"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockBuilder ¶
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 ¶
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 ¶
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 ¶
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 ¶
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.