feat(provider): hashed state methods for trie related providers (#9510)

This commit is contained in:
Roman Krasiuk
2024-07-15 05:55:19 -07:00
committed by GitHub
parent 414df3e093
commit 499e0f10f7
10 changed files with 110 additions and 70 deletions

View File

@ -5,8 +5,7 @@ use reth_storage_api::{
AccountReader, BlockHashReader, StateProofProvider, StateProvider, StateRootProvider,
};
use reth_storage_errors::provider::ProviderResult;
use reth_trie::{updates::TrieUpdates, AccountProof};
use revm::db::BundleState;
use reth_trie::{updates::TrieUpdates, AccountProof, HashedPostState};
use std::collections::HashMap;
/// Mock state for testing
@ -66,22 +65,22 @@ impl BlockHashReader for StateProviderTest {
}
impl StateRootProvider for StateProviderTest {
fn state_root(&self, _bundle_state: &BundleState) -> ProviderResult<B256> {
fn hashed_state_root(&self, _hashed_state: &HashedPostState) -> ProviderResult<B256> {
unimplemented!("state root computation is not supported")
}
fn state_root_with_updates(
fn hashed_state_root_with_updates(
&self,
_bundle_state: &BundleState,
_hashed_state: &HashedPostState,
) -> ProviderResult<(B256, TrieUpdates)> {
unimplemented!("state root computation is not supported")
}
}
impl StateProofProvider for StateProviderTest {
fn proof(
fn hashed_proof(
&self,
_state: &BundleState,
_hashed_state: &HashedPostState,
_address: Address,
_slots: &[B256],
) -> ProviderResult<AccountProof> {