From cf963b1957e4e567bb14fff2960ca27006707ee2 Mon Sep 17 00:00:00 2001 From: Nikolay Volf Date: Mon, 1 Feb 2016 15:35:13 +0400 Subject: [PATCH] more of env_info --- ethcore/src/env_info.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/ethcore/src/env_info.rs b/ethcore/src/env_info.rs index d1dcfbe02..8b037036e 100644 --- a/ethcore/src/env_info.rs +++ b/ethcore/src/env_info.rs @@ -67,22 +67,28 @@ mod tests { use super::*; use rustc_serialize::*; use util::from_json::FromJson; + use util::hash::*; + use std::str::FromStr; #[test] fn it_serializes_form_json() { let env_info = EnvInfo::from_json(&json::Json::from_str( r#" { - "currentCoinbase": "0x0000000000000000000000000000000000000000", - "currentNumber": 0, - "currentDifficulty": 0, - "currentGasLimit" : 0, - "currentTimestamp" : 0 + "currentCoinbase": "0x000000f00000000f000000000000f00000000f00", + "currentNumber": 1112339, + "currentDifficulty": 50000, + "currentGasLimit" : 40000, + "currentTimestamp" : 1100 } "# ).unwrap()); - assert_eq!(env_info.number, 0); + assert_eq!(env_info.number, 1112339); + assert_eq!(env_info.author, Address::from_str("000000f00000000f000000000000f00000000f00").unwrap()); + assert_eq!(env_info.gas_limit, x!(40000)); + assert_eq!(env_info.difficulty, x!(50000)); + assert_eq!(env_info.gas_used, x!(0)); } #[test]