Tests for JSON serialisation of statediff/vmtrace (#1241)

* Splitting RPC Apis into more fine-grained sets

* Remove old code/comment.

* Add test for VMTrace ser.

* Add StateDiff ser test.
This commit is contained in:
Gav Wood
2016-06-08 12:40:55 -07:00
parent a72ee5c16a
commit 293d9f15d5
2 changed files with 66 additions and 16 deletions

View File

@@ -38,23 +38,7 @@ pub struct Block {
impl Block {
/// Returns true if the given bytes form a valid encoding of a block in RLP.
// TODO: implement Decoder for this and have this use that.
pub fn is_good(b: &[u8]) -> bool {
/*
let urlp = UntrustedRlp::new(&b);
if !urlp.is_list() || urlp.item_count() != 3 || urlp.size() != b.len() { return false; }
if urlp.val_at::<Header>(0).is_err() { return false; }
if !urlp.at(1).unwrap().is_list() { return false; }
if urlp.at(1).unwrap().iter().find(|i| i.as_val::<Transaction>().is_err()).is_some() {
return false;
}
if !urlp.at(2).unwrap().is_list() { return false; }
if urlp.at(2).unwrap().iter().find(|i| i.as_val::<Header>().is_err()).is_some() {
return false;
}
true*/
UntrustedRlp::new(b).as_val::<Block>().is_ok()
}
}