add asserts in spec::authority_round's unit test

This commit is contained in:
Guanqun Lu 2017-05-12 23:51:02 +08:00
parent a0dd77ca01
commit c0a8eaa3bf
1 changed files with 8 additions and 0 deletions

View File

@ -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))));
}
}