tests for loading test json files
This commit is contained in:
@@ -47,8 +47,12 @@ impl Visitor for UintVisitor {
|
||||
let value = match value.len() {
|
||||
0 => U256::from(0),
|
||||
2 if value.starts_with("0x") => U256::from(0),
|
||||
_ if value.starts_with("0x") => try!(U256::from_str(&value[2..]).map_err(|_| Error::custom("invalid hex value."))),
|
||||
_ => try!(U256::from_dec_str(value).map_err(|_| Error::custom("invalid decimal value.")))
|
||||
_ if value.starts_with("0x") => try!(U256::from_str(&value[2..]).map_err(|_| {
|
||||
Error::custom(format!("Invalid hex value {}.", value).as_ref())
|
||||
})),
|
||||
_ => try!(U256::from_dec_str(value).map_err(|_| {
|
||||
Error::custom(format!("Invalid decimal value {}.", value).as_ref())
|
||||
}))
|
||||
};
|
||||
|
||||
Ok(Uint(value))
|
||||
|
||||
Reference in New Issue
Block a user