Check in block authoring that we can author with current authoring version (#4201)

* Check in block authoring that we can author with current authoring version

* Update client/consensus/pow/src/lib.rs

Co-Authored-By: André Silva <andre.beat@gmail.com>

* Fix compilation
This commit is contained in:
Bastian Köcher
2019-11-29 11:01:11 +01:00
committed by GitHub
parent 0b52f194f5
commit accc678640
18 changed files with 187 additions and 62 deletions
@@ -547,7 +547,8 @@ fn runtime_version<Block: BlockT, F: Fetcher<Block>>(
Bytes(Vec::new()),
)
.then(|version| ready(version.and_then(|version|
Decode::decode(&mut &version.0[..]).map_err(|_| client_err(ClientError::VersionInvalid))
Decode::decode(&mut &version.0[..])
.map_err(|e| client_err(ClientError::VersionInvalid(e.what().into())))
)))
}
@@ -696,7 +697,7 @@ fn ignore_error<F, T>(future: F) -> impl std::future::Future<Output=Result<Optio
future.then(|result| ready(match result {
Ok(result) => Ok(Some(result)),
Err(()) => Ok(None),
}))
}))
}
#[cfg(test)]