reth_storage_api/
account.rsuse alloy_primitives::{Address, BlockNumber};
use auto_impl::auto_impl;
use reth_db_models::AccountBeforeTx;
use reth_primitives::Account;
use reth_storage_errors::provider::ProviderResult;
use std::{
collections::{BTreeMap, BTreeSet},
ops::{RangeBounds, RangeInclusive},
};
#[auto_impl(&, Arc, Box)]
pub trait AccountReader: Send + Sync {
fn basic_account(&self, address: Address) -> ProviderResult<Option<Account>>;
}
#[auto_impl(&, Arc, Box)]
pub trait AccountExtReader: Send + Sync {
fn changed_accounts_with_range(
&self,
_range: impl RangeBounds<BlockNumber>,
) -> ProviderResult<BTreeSet<Address>>;
fn basic_accounts(
&self,
_iter: impl IntoIterator<Item = Address>,
) -> ProviderResult<Vec<(Address, Option<Account>)>>;
fn changed_accounts_and_blocks_with_range(
&self,
range: RangeInclusive<BlockNumber>,
) -> ProviderResult<BTreeMap<Address, Vec<BlockNumber>>>;
}
#[auto_impl(&, Arc, Box)]
pub trait ChangeSetReader: Send + Sync {
fn account_block_changeset(
&self,
block_number: BlockNumber,
) -> ProviderResult<Vec<AccountBeforeTx>>;
}