Make HashDB generic (#8739)
The `patricia_trie` crate is generic over the hasher (by way of HashDB) and node encoding scheme. Adds a new `patricia_trie_ethereum` crate with concrete impls for Keccak/RLP.
This commit is contained in:
@@ -8,6 +8,7 @@ byteorder = "1.0"
|
||||
ethcore-bytes = { path = "../../util/bytes" }
|
||||
ethereum-types = "0.3"
|
||||
patricia-trie = { path = "../../util/patricia_trie" }
|
||||
patricia-trie-ethereum = { path = "../../util/patricia-trie-ethereum" }
|
||||
log = "0.3"
|
||||
common-types = { path = "../types" }
|
||||
ethjson = { path = "../../json" }
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
//! VM errors module
|
||||
|
||||
use trie;
|
||||
use std::fmt;
|
||||
use ethtrie;
|
||||
|
||||
/// VM errors.
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
@@ -71,8 +71,13 @@ pub enum Error {
|
||||
Reverted,
|
||||
}
|
||||
|
||||
impl From<Box<trie::TrieError>> for Error {
|
||||
fn from(err: Box<trie::TrieError>) -> Self {
|
||||
impl From<Box<ethtrie::TrieError>> for Error {
|
||||
fn from(err: Box<ethtrie::TrieError>) -> Self {
|
||||
Error::Internal(format!("Internal error: {}", err))
|
||||
}
|
||||
}
|
||||
impl From<ethtrie::TrieError> for Error {
|
||||
fn from(err: ethtrie::TrieError) -> Self {
|
||||
Error::Internal(format!("Internal error: {}", err))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ extern crate common_types as types;
|
||||
extern crate ethjson;
|
||||
extern crate rlp;
|
||||
extern crate keccak_hash as hash;
|
||||
extern crate patricia_trie_ethereum as ethtrie;
|
||||
extern crate patricia_trie as trie;
|
||||
|
||||
mod action_params;
|
||||
|
||||
Reference in New Issue
Block a user