Skip to content
Snippets Groups Projects
Unverified Commit 7b881ef3 authored by Shaopeng Wang's avatar Shaopeng Wang Committed by GitHub
Browse files

fmt (#192)

parent 249f4bda
No related branches found
No related tags found
No related merge requests found
//! Runtime API definition for oracle module. //! Runtime API definition for oracle module.
#![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(not(feature = "std"), no_std)]
// The `too_many_arguments` warning originates from `decl_runtime_apis` macro. // The `too_many_arguments` warning originates from `decl_runtime_apis` macro.
#![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_arguments)]
......
...@@ -59,12 +59,11 @@ where ...@@ -59,12 +59,11 @@ where
let at = BlockId::hash(at.unwrap_or_else(|| let at = BlockId::hash(at.unwrap_or_else(||
// If the block hash is not supplied assume the best block. // If the block hash is not supplied assume the best block.
self.client.info().best_hash)); self.client.info().best_hash));
api.get_value(&at, key) api.get_value(&at, key).map_err(|e| RpcError {
.map_err(|e| RpcError { code: ErrorCode::ServerError(Error::RuntimeError.into()),
code: ErrorCode::ServerError(Error::RuntimeError.into()), message: "Unable to get value.".into(),
message: "Unable to get value.".into(), data: Some(format!("{:?}", e).into()),
data: Some(format!("{:?}", e).into()), })
})
} }
fn get_all_values(&self, at: Option<<Block as BlockT>::Hash>) -> Result<Vec<(Key, Option<Value>)>> { fn get_all_values(&self, at: Option<<Block as BlockT>::Hash>) -> Result<Vec<(Key, Option<Value>)>> {
...@@ -72,11 +71,10 @@ where ...@@ -72,11 +71,10 @@ where
let at = BlockId::hash(at.unwrap_or_else(|| let at = BlockId::hash(at.unwrap_or_else(||
// If the block hash is not supplied assume the best block. // If the block hash is not supplied assume the best block.
self.client.info().best_hash)); self.client.info().best_hash));
api.get_all_values(&at) api.get_all_values(&at).map_err(|e| RpcError {
.map_err(|e| RpcError { code: ErrorCode::ServerError(Error::RuntimeError.into()),
code: ErrorCode::ServerError(Error::RuntimeError.into()), message: "Unable to get all values.".into(),
message: "Unable to get all values.".into(), data: Some(format!("{:?}", e).into()),
data: Some(format!("{:?}", e).into()), })
})
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment