tests for loading test json files

This commit is contained in:
debris
2016-03-15 19:32:07 +01:00
committed by arkpar
parent 24993b8d4e
commit c15e78cd95
7 changed files with 215 additions and 12 deletions

View File

@@ -28,3 +28,23 @@ pub struct Account {
nonce: Uint,
storage: BTreeMap<Uint, Bytes>,
}
#[cfg(test)]
mod tests {
use serde_json;
use blockchain::account::Account;
#[test]
fn header_deserialization() {
let s = r#"{
"balance" : "0x09184e72a078",
"code" : "0x600140600155",
"nonce" : "0x00",
"storage" : {
"0x01" : "0x9a10c2b5bb8f3c602e674006d9b21f09167df57c87a78a5ce96d4159ecb76520"
}
}"#;
let _deserialized: Account= serde_json::from_str(s).unwrap();
// TODO: validate all fields
}
}