reth_trie_db/
commitment.rsuse crate::{
DatabaseHashedCursorFactory, DatabaseProof, DatabaseStateRoot, DatabaseStorageRoot,
DatabaseTrieCursorFactory, DatabaseTrieWitness,
};
use reth_db::transaction::DbTx;
use reth_trie::{
proof::Proof, witness::TrieWitness, KeccakKeyHasher, KeyHasher, StateRoot, StorageRoot,
};
pub trait StateCommitment: std::fmt::Debug + Send + Sync + Unpin + 'static {
type StateRoot<'a, TX: DbTx + 'a>: DatabaseStateRoot<'a, TX>;
type StorageRoot<'a, TX: DbTx + 'a>: DatabaseStorageRoot<'a, TX>;
type StateProof<'a, TX: DbTx + 'a>: DatabaseProof<'a, TX>;
type StateWitness<'a, TX: DbTx + 'a>: DatabaseTrieWitness<'a, TX>;
type KeyHasher: KeyHasher;
}
#[derive(Debug)]
#[non_exhaustive]
pub struct MerklePatriciaTrie;
impl StateCommitment for MerklePatriciaTrie {
type StateRoot<'a, TX: DbTx + 'a> =
StateRoot<DatabaseTrieCursorFactory<'a, TX>, DatabaseHashedCursorFactory<'a, TX>>;
type StorageRoot<'a, TX: DbTx + 'a> =
StorageRoot<DatabaseTrieCursorFactory<'a, TX>, DatabaseHashedCursorFactory<'a, TX>>;
type StateProof<'a, TX: DbTx + 'a> =
Proof<DatabaseTrieCursorFactory<'a, TX>, DatabaseHashedCursorFactory<'a, TX>>;
type StateWitness<'a, TX: DbTx + 'a> =
TrieWitness<DatabaseTrieCursorFactory<'a, TX>, DatabaseHashedCursorFactory<'a, TX>>;
type KeyHasher = KeccakKeyHasher;
}