make block builder and construct_runtime! generic over inherent-data (#1191)

* make block builder generic over inherent-data

* construct_runtime has you specify inherent data type

* get all tests to compile
This commit is contained in:
Robert Habermeier
2018-12-03 11:49:30 +01:00
committed by GitHub
parent 69a288e586
commit 63980e3770
17 changed files with 96 additions and 109 deletions
+4 -4
View File
@@ -463,17 +463,17 @@ macro_rules! impl_outer_log {
}
//TODO: https://github.com/paritytech/substrate/issues/1022
/// Inherent data to include in a block.
/// Basic Inherent data to include in a block; used by simple runtimes.
#[derive(Encode, Decode)]
pub struct InherentData {
pub struct BasicInherentData {
/// Current timestamp.
pub timestamp: u64,
/// Indices of offline validators.
pub consensus: Vec<u32>,
}
impl InherentData {
/// Create a new `InherentData` instance.
impl BasicInherentData {
/// Create a new `BasicInherentData` instance.
pub fn new(timestamp: u64, consensus: Vec<u32>) -> Self {
Self {
timestamp,