rpc block serialize test

This commit is contained in:
debris 2016-01-26 11:51:35 +01:00
parent b1282fe1f4
commit d27c7f3902

View File

@ -1,7 +1,7 @@
use util::hash::*; use util::hash::*;
use util::uint::*; use util::uint::*;
#[derive(Serialize)] #[derive(Default, Serialize)]
pub struct Block { pub struct Block {
hash: H256, hash: H256,
#[serde(rename="parentHash")] #[serde(rename="parentHash")]
@ -30,3 +30,12 @@ pub struct Block {
timestamp: u64 timestamp: u64
} }
#[test]
fn test_block_serialize() {
use serde_json;
let block = Block::default();
let serialized = serde_json::to_string(&block).unwrap();
println!("s: {:?}", serialized);
assert!(false);
}