sp-inherents

Crates.iosp-inherents
lib.rssp-inherents
version34.0.0
sourcesrc
created_at2020-02-27 00:54:20.262814
updated_at2024-07-18 13:18:52.674672
descriptionProvides types and traits for creating and checking inherents. (polkadot v1.15.0)
homepagehttps://substrate.io
repositoryhttps://github.com/paritytech/polkadot-sdk.git
max_upload_size
id212904
size25,944
Parity Crate Owner (parity-crate-owner)

documentation

https://docs.rs/sp-inherents

README

Provides types and traits for creating and checking inherents.

Each inherent is added to a produced block. Each runtime decides on which inherents it wants to attach to its blocks. All data that is required for the runtime to create the inherents is stored in the InherentData. This InherentData is constructed by the node and given to the runtime.

Types that provide data for inherents, should implement InherentDataProvider and need to be registered at InherentDataProviders.

In the runtime, modules need to implement ProvideInherent when they can create and/or check inherents. By implementing ProvideInherent, a module is not enforced to create an inherent. A module can also just check given inherents. For using a module as inherent provider, it needs to be registered by the construct_runtime! macro. The macro documentation gives more information on how that is done.

License: Apache-2.0

Commit count: 18077

cargo fmt