mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix(provider): latest provider proof method (#5695)
This commit is contained in:
@ -9,10 +9,9 @@ use reth_db::{
|
|||||||
};
|
};
|
||||||
use reth_interfaces::provider::{ProviderError, ProviderResult};
|
use reth_interfaces::provider::{ProviderError, ProviderResult};
|
||||||
use reth_primitives::{
|
use reth_primitives::{
|
||||||
keccak256, trie::AccountProof, Account, Address, BlockNumber, Bytecode, StorageKey,
|
trie::AccountProof, Account, Address, BlockNumber, Bytecode, StorageKey, StorageValue, B256,
|
||||||
StorageValue, B256,
|
|
||||||
};
|
};
|
||||||
use reth_trie::updates::TrieUpdates;
|
use reth_trie::{proof::Proof, updates::TrieUpdates};
|
||||||
|
|
||||||
/// State provider over latest state that takes tx reference.
|
/// State provider over latest state that takes tx reference.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
@ -95,17 +94,10 @@ impl<'b, TX: DbTx> StateProvider for LatestStateProviderRef<'b, TX> {
|
|||||||
self.db.get::<tables::Bytecodes>(code_hash).map_err(Into::into)
|
self.db.get::<tables::Bytecodes>(code_hash).map_err(Into::into)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn proof(&self, address: Address, _keys: &[B256]) -> ProviderResult<AccountProof> {
|
fn proof(&self, address: Address, slots: &[B256]) -> ProviderResult<AccountProof> {
|
||||||
let _hashed_address = keccak256(address);
|
Ok(Proof::new(self.db)
|
||||||
let _root = self
|
.account_proof(address, slots)
|
||||||
.db
|
.map_err(Into::<reth_db::DatabaseError>::into)?)
|
||||||
.cursor_read::<tables::Headers>()?
|
|
||||||
.last()?
|
|
||||||
.ok_or_else(|| ProviderError::HeaderNotFound(0.into()))?
|
|
||||||
.1
|
|
||||||
.state_root;
|
|
||||||
|
|
||||||
unimplemented!()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user