From a61b249d57f4c87abd8dcdc9c179f146bc5c7a7c Mon Sep 17 00:00:00 2001 From: Guanqun Lu Date: Sun, 14 May 2017 10:53:53 +0800 Subject: [PATCH] add asserts in tendermint.rs --- json/src/spec/tendermint.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/json/src/spec/tendermint.rs b/json/src/spec/tendermint.rs index 16c2d7255..5a15a0841 100644 --- a/json/src/spec/tendermint.rs +++ b/json/src/spec/tendermint.rs @@ -57,7 +57,12 @@ pub struct Tendermint { #[cfg(test)] mod tests { use serde_json; + use uint::Uint; + use util::U256; + use hash::Address; + use util::hash::H160; use spec::tendermint::Tendermint; + use spec::validator_set::ValidatorSet; #[test] fn tendermint_deserialization() { @@ -71,6 +76,10 @@ mod tests { } }"#; - let _deserialized: Tendermint = serde_json::from_str(s).unwrap(); + let deserialized: Tendermint = serde_json::from_str(s).unwrap(); + assert_eq!(deserialized.params.gas_limit_bound_divisor, Uint(U256::from(0x0400))); + let vs = ValidatorSet::List(vec![Address(H160::from("0xc6d9d2cd449a754c494264e1809c50e34d64562b"))]); + assert_eq!(deserialized.params.validators, vs); + assert_eq!(deserialized.params.block_reward, Some(Uint(U256::from(0x50)))); } }