3 stable releases

2.1.2 Jun 23, 2021
2.0.2 Apr 3, 2021
2.0.1 Apr 2, 2021

#1556 in Magic Beans

Download history 118/week @ 2021-07-04 89/week @ 2021-07-11 51/week @ 2021-07-18 53/week @ 2021-07-25 46/week @ 2021-08-01 67/week @ 2021-08-08 37/week @ 2021-08-15 31/week @ 2021-08-22 1/week @ 2021-08-29 13/week @ 2021-09-05 20/week @ 2021-09-12 17/week @ 2021-09-19 11/week @ 2021-10-03 13/week @ 2021-10-10 16/week @ 2021-10-17

489 downloads per month
Used in 119 crates (29 directly)

Apache-2.0

255KB
5K SLoC

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


lib.rs:

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.

Dependencies

~2.3–5MB
~97K SLoC

г`