From 04e22cd7954d659af78d6b85b919fa479383e968 Mon Sep 17 00:00:00 2001 From: Svyatoslav Nikolsky <svyatonik@gmail.com> Date: Wed, 19 Sep 2018 16:26:36 +0300 Subject: [PATCH] cleanup client errors (#771) --- substrate/core/client/src/client.rs | 2 +- substrate/core/client/src/error.rs | 32 ++++------------------------- 2 files changed, 5 insertions(+), 29 deletions(-) diff --git a/substrate/core/client/src/client.rs b/substrate/core/client/src/client.rs index 7baa9951f73..06d61786e07 100644 --- a/substrate/core/client/src/client.rs +++ b/substrate/core/client/src/client.rs @@ -239,7 +239,7 @@ impl<B, E, Block> Client<B, E, Block> where Some(cached_value) => Ok(cached_value), None => self.executor.call(id, "authorities",&[]) .and_then(|r| Vec::<AuthorityId>::decode(&mut &r.return_data[..]) - .ok_or(error::ErrorKind::AuthLenInvalid.into())) + .ok_or(error::ErrorKind::InvalidAuthoritiesSet.into())) } } diff --git a/substrate/core/client/src/error.rs b/substrate/core/client/src/error.rs index b1eb27385ba..05429b9566b 100644 --- a/substrate/core/client/src/error.rs +++ b/substrate/core/client/src/error.rs @@ -52,22 +52,10 @@ error_chain! { display("Blockchain: {}", e), } - /// Invalid state data. - AuthLenEmpty { - description("authority count state error"), - display("Current state of blockchain has no authority count value"), - } - - /// Invalid state data. - AuthEmpty(i: u32) { - description("authority value state error"), - display("Current state of blockchain has no authority value for index {}", i), - } - - /// Invalid state data. - AuthLenInvalid { - description("authority count state error"), - display("Current state of blockchain has invalid authority count value"), + /// Invalid authorities set received from the runtime. + InvalidAuthoritiesSet { + description("authorities set is invalid"), + display("Current state of blockchain has invalid authorities set"), } /// Cound not get runtime version. @@ -76,12 +64,6 @@ error_chain! { display("On-chain runtime does not specify version"), } - /// Invalid state data. - AuthInvalid(i: u32) { - description("authority value state error"), - display("Current state of blockchain has invalid authority value for index {}", i), - } - /// Bad justification for header. BadJustification(h: String) { description("bad justification for header"), @@ -100,12 +82,6 @@ error_chain! { display("Remote node has responded with invalid header proof"), } - /// Invalid remote execution proof. - InvalidExecutionProof { - description("invalid execution proof"), - display("Remote node has responded with invalid execution proof"), - } - /// Remote fetch has been cancelled. RemoteFetchCancelled { description("remote fetch cancelled"), -- GitLab