Move macros to util.

This commit is contained in:
Gav Wood
2016-01-13 23:07:01 +01:00
parent 78b10fd5f2
commit 08824e3ece
3 changed files with 1 additions and 32 deletions

View File

@@ -2,13 +2,6 @@ use super::test_common::*;
use state::*;
use ethereum;
pub fn hashmap_h256_h256_from_json(json: &Json) -> HashMap<H256, H256> {
json.as_object().unwrap().iter().fold(HashMap::new(), |mut m, (key, value)| {
m.insert(H256::from(&u256_from_hex(key)), H256::from(&u256_from_json(value)));
m
})
}
pub fn map_h256_h256_from_json(json: &Json) -> BTreeMap<H256, H256> {
json.as_object().unwrap().iter().fold(BTreeMap::new(), |mut m, (key, value)| {
m.insert(H256::from(&u256_from_hex(key)), H256::from(&u256_from_json(value)));