From c0a8eaa3bf936aace24e9fb8b7e516facbfab94d Mon Sep 17 00:00:00 2001 From: Guanqun Lu Date: Fri, 12 May 2017 23:51:02 +0800 Subject: [PATCH] add asserts in spec::authority_round's unit test --- json/src/spec/authority_round.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/json/src/spec/authority_round.rs b/json/src/spec/authority_round.rs index 83e029c56..ae518eebc 100644 --- a/json/src/spec/authority_round.rs +++ b/json/src/spec/authority_round.rs @@ -62,7 +62,10 @@ pub struct AuthorityRound { mod tests { use uint::Uint; use util::U256; + use util::H160; use serde_json; + use hash::Address; + use spec::validator_set::ValidatorSet; use spec::authority_round::AuthorityRound; #[test] @@ -84,5 +87,10 @@ mod tests { let deserialized: AuthorityRound = serde_json::from_str(s).unwrap(); assert_eq!(deserialized.params.gas_limit_bound_divisor, Uint(U256::from(0x0400))); assert_eq!(deserialized.params.step_duration, Uint(U256::from(0x02))); + assert_eq!(deserialized.params.validators, ValidatorSet::List(vec![Address(H160::from("0xc6d9d2cd449a754c494264e1809c50e34d64562b"))])); + assert_eq!(deserialized.params.block_reward, Some(Uint(U256::from(0x50)))); + assert!(deserialized.params.registrar.is_none()); + assert_eq!(deserialized.params.start_step, Some(Uint(U256::from(24)))); + assert_eq!(deserialized.params.eip155_transition, Some(Uint(U256::from(0x42)))); } }