Fix nits in rpc error display. (#6302)

* Improve rpc error display.

* Apply review suggestion.

* Apply review suggestion.

* Update client/rpc-api/src/author/error.rs

* Fix custom.

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Marcio Diaz
2020-06-10 11:10:02 +02:00
committed by GitHub
parent 7c47a3b5ad
commit 2729a48893
3 changed files with 14 additions and 5 deletions
+2 -2
View File
@@ -64,7 +64,7 @@ where
Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + BlockIdTo<Block>,
Client: Send + Sync + 'static,
Client::Api: TaggedTransactionQueue<Block>,
sp_api::ApiErrorFor<Client, Block>: Send,
sp_api::ApiErrorFor<Client, Block>: Send + std::fmt::Display,
{
type Block = Block;
type Error = error::Error;
@@ -105,7 +105,7 @@ where
#[allow(deprecated)] // old validate_transaction
runtime_api.validate_transaction_before_version_2(&at, uxt)
};
let res = res.map_err(|e| Error::RuntimeApi(format!("{:?}", e)));
let res = res.map_err(|e| Error::RuntimeApi(e.to_string()));
if let Err(e) = tx.send(res) {
log::warn!("Unable to send a validate transaction result: {:?}", e);
}