Allow batch query for block hash. (#4210)

This commit is contained in:
Tomasz Drwięga
2019-11-26 18:07:31 +01:00
committed by Gavin Wood
parent 70bc6eaed6
commit cfb590ac4b
8 changed files with 159 additions and 20 deletions
+17
View File
@@ -19,3 +19,20 @@
#![warn(missing_docs)]
pub mod number;
pub mod list;
/// A util function to assert the result of serialization and deserialization is the same.
#[cfg(test)]
pub(crate) fn assert_deser<T>(s: &str, expected: T) where
T: std::fmt::Debug + serde::ser::Serialize + serde::de::DeserializeOwned + PartialEq
{
assert_eq!(
serde_json::from_str::<T>(s).unwrap(),
expected
);
assert_eq!(
serde_json::to_string(&expected).unwrap(),
s
);
}