rpc block serialize test
This commit is contained in:
parent
b1282fe1f4
commit
d27c7f3902
@ -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);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user