#tetcoin #framework #blockchain #crypto #data-provider

no-std tp-inherents

Provides types and traits for creating and checking inherents

Show the crate…

3 stable releases

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

#29 in #data-provider

Download history 67/week @ 2024-01-01 181/week @ 2024-01-08 133/week @ 2024-01-15 111/week @ 2024-01-22 91/week @ 2024-01-29 156/week @ 2024-02-05 189/week @ 2024-02-12 124/week @ 2024-02-19 220/week @ 2024-02-26 223/week @ 2024-03-04 165/week @ 2024-03-11 200/week @ 2024-03-18 356/week @ 2024-03-25 349/week @ 2024-04-01 144/week @ 2024-04-08 219/week @ 2024-04-15

1,072 downloads per month
Used in 120 crates (29 directly)

Apache-2.0

260KB
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

~3–12MB
~120K SLoC