Simplify runtime api error handling (#8114)

* Ahh

* Work work work

* Fix all the compilation errors

* Fix test

* More fixes...
This commit is contained in:
Bastian Köcher
2021-02-15 12:55:40 +01:00
committed by GitHub
parent b5e692104c
commit 33f9becf41
48 changed files with 270 additions and 415 deletions
+5 -3
View File
@@ -295,6 +295,8 @@ pub enum Error {
Safety(String),
/// A timer failed to fire.
Timer(io::Error),
/// A runtime api request failed.
RuntimeApi(sp_api::ApiError),
}
impl From<GrandpaError> for Error {
@@ -698,7 +700,7 @@ where
NumberFor<Block>: BlockNumberOps,
DigestFor<Block>: Encode,
C: ClientForGrandpa<Block, BE> + 'static,
C::Api: GrandpaApi<Block, Error = sp_blockchain::Error>,
C::Api: GrandpaApi<Block>,
{
let GrandpaParams {
mut config,
@@ -824,7 +826,7 @@ where
Block: BlockT,
B: Backend<Block> + 'static,
C: ClientForGrandpa<Block, B> + 'static,
C::Api: GrandpaApi<Block, Error = sp_blockchain::Error>,
C::Api: GrandpaApi<Block>,
N: NetworkT<Block> + Sync,
NumberFor<Block>: BlockNumberOps,
SC: SelectChain<Block> + 'static,
@@ -1042,7 +1044,7 @@ where
NumberFor<Block>: BlockNumberOps,
SC: SelectChain<Block> + 'static,
C: ClientForGrandpa<Block, B> + 'static,
C::Api: GrandpaApi<Block, Error = sp_blockchain::Error>,
C::Api: GrandpaApi<Block>,
VR: VotingRule<Block, C> + Clone + 'static,
{
type Output = Result<(), Error>;