From 3f492d5ac2079f12b9ea0369ff115009fc256ed8 Mon Sep 17 00:00:00 2001 From: Nikolay Volf Date: Sat, 30 Jan 2016 15:53:16 +0400 Subject: [PATCH] podstate trivia --- src/pod_state.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/pod_state.rs b/src/pod_state.rs index 15ae6a8ae..f37a327f8 100644 --- a/src/pod_state.rs +++ b/src/pod_state.rs @@ -53,3 +53,31 @@ impl fmt::Display for PodState { Ok(()) } } + +#[cfg(test)] +mod tests { + extern crate rustc_serialize; + + use super::*; + use rustc_serialize::*; + use util::from_json::FromJson; + use util::hash::*; + + #[test] + fn it_serializes_form_json() { + let pod_state = PodState::from_json(&json::Json::from_str( +r#" + { + "0000000000000000000000000000000000000000": { + "balance": "1000", + "nonce": "100", + "storage": {}, + "code" : [] + } + } +"# + ).unwrap()); + + assert!(pod_state.get().get(&ZERO_ADDRESS).is_some()); + } +}