pub fn build(map: &HashMap<Vec<u8>, Vec<u8>>) -> (H256, Change) {
    let mut change = Change::default();

    if map.len() == 0 {
        return (empty_trie_hash!(), change);
    }

    let mut node_map = HashMap::new();
    for (key, value) in map {
        node_map.insert(nibble::from_key(key.as_ref()), value.as_ref());
    }

    let (node, subchange) = build::build_node(&node_map);
    change.merge(&subchange);
    change.add_node(&node);

    let hash = H256::from(Keccak256::digest(&rlp::encode(&node).to_vec()).as_slice());
    (hash, change)
}
/// Build a merkle trie from a map. Return the root hash and the
/// changes.
Build a merkle trie from a map. Return the root hash and the
changes.
Build a merkle trie from a map . Return the root hash and the changes .
pub fn build(map: &HashMap<Vec<u8>, Vec<u8>>) -> (H256, Change) {
    let mut change = Change::default();
    if map.len() == 0 {
        return (empty_trie_hash!(), change);
    }
    let mut node_map = HashMap::new();
    for (key, value) in map {
        node_map.insert(nibble::from_key(key.as_ref()), value.as_ref());
    }
    let (node, subchange) = build::build_node(&node_map);
    change.merge(&subchange);
    change.add_node(&node);
    let hash = H256::from(Keccak256::digest(&rlp::encode(&node).to_vec()).as_slice());
    (hash, change)
}
pub fn build ( map : & HashMap < Vec < u8 > , Vec < u8 > > ) -> ( H256 , Change ) { let mut change = Change :: default ( ) ; if map . len ( ) == 0 { return ( empty_trie_hash ! ( ) , change ) ; } let mut node_map = HashMap :: new ( ) ; for ( key , value ) in map { node_map . insert ( nibble :: from_key ( key . as_ref ( ) ) , value . as_ref ( ) ) ; } let ( node , subchange ) = build :: build_node ( & node_map ) ; change . merge ( & subchange ) ; change . add_node ( & node ) ; let hash = H256 :: from ( Keccak256 :: digest ( & rlp :: encode ( & node ) . to_vec ( ) ) . as_slice ( ) ) ; ( hash , change ) }
Build a merkle trie from a map.
Build a merkle trie from a map .
map
&HashMap<Vec<u8>, Vec<u8>>