handling invalid spec jsons properly, additional tests, closes #1840

This commit is contained in:
debris
2016-09-05 17:41:34 +02:00
parent 4e466f09db
commit aa8b871e49
6 changed files with 41 additions and 28 deletions

View File

@@ -16,7 +16,6 @@
//! Diff misc.
use std::fs::File;
use common::*;
use rlp::{Stream, RlpStream};
use target_info::Target;
@@ -33,14 +32,6 @@ pub enum Filth {
Dirty,
}
/// Read the whole contents of a file `name`.
pub fn contents(name: &str) -> Result<Bytes, UtilError> {
let mut file = try!(File::open(name));
let mut ret: Vec<u8> = Vec::new();
try!(file.read_to_end(&mut ret));
Ok(ret)
}
/// Get the standard version string for this software.
pub fn version() -> String {
let sha3 = short_sha();
@@ -64,4 +55,4 @@ pub fn version_data() -> Bytes {
s.append(&rustc_version());
s.append(&&Target::os()[0..2]);
s.out()
}
}