mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: get rid of lifetime GATs (#5478)
This commit is contained in:
@ -25,7 +25,7 @@ pub(crate) fn bench<F1, F2, R>(
|
||||
) -> eyre::Result<()>
|
||||
where
|
||||
F1: FnMut() -> eyre::Result<R>,
|
||||
F2: Fn(DatabaseProviderRO<'_, DatabaseEnv>) -> eyre::Result<R>,
|
||||
F2: Fn(DatabaseProviderRO<DatabaseEnv>) -> eyre::Result<R>,
|
||||
R: Debug + PartialEq,
|
||||
{
|
||||
let (db, chain) = db;
|
||||
|
||||
@ -22,7 +22,7 @@ use std::{
|
||||
impl Command {
|
||||
pub(crate) fn generate_headers_snapshot<DB: Database>(
|
||||
&self,
|
||||
provider: &DatabaseProviderRO<'_, DB>,
|
||||
provider: &DatabaseProviderRO<DB>,
|
||||
compression: Compression,
|
||||
inclusion_filter: InclusionFilter,
|
||||
phf: PerfectHashingFunction,
|
||||
|
||||
@ -22,7 +22,7 @@ use std::{
|
||||
impl Command {
|
||||
pub(crate) fn generate_receipts_snapshot<DB: Database>(
|
||||
&self,
|
||||
provider: &DatabaseProviderRO<'_, DB>,
|
||||
provider: &DatabaseProviderRO<DB>,
|
||||
compression: Compression,
|
||||
inclusion_filter: InclusionFilter,
|
||||
phf: PerfectHashingFunction,
|
||||
|
||||
@ -22,7 +22,7 @@ use std::{
|
||||
impl Command {
|
||||
pub(crate) fn generate_transactions_snapshot<DB: Database>(
|
||||
&self,
|
||||
provider: &DatabaseProviderRO<'_, DB>,
|
||||
provider: &DatabaseProviderRO<DB>,
|
||||
compression: Compression,
|
||||
inclusion_filter: InclusionFilter,
|
||||
phf: PerfectHashingFunction,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
//! Reth genesis initialization utility functions.
|
||||
use reth_db::{
|
||||
cursor::DbCursorRO,
|
||||
database::{Database, DatabaseGAT},
|
||||
database::Database,
|
||||
tables,
|
||||
transaction::{DbTx, DbTxMut},
|
||||
};
|
||||
@ -94,7 +94,7 @@ pub fn init_genesis<DB: Database>(
|
||||
|
||||
/// Inserts the genesis state into the database.
|
||||
pub fn insert_genesis_state<DB: Database>(
|
||||
tx: &<DB as DatabaseGAT<'_>>::TXMut,
|
||||
tx: &<DB as Database>::TXMut,
|
||||
genesis: &reth_primitives::Genesis,
|
||||
) -> ProviderResult<()> {
|
||||
let mut state_init: BundleStateInit = HashMap::new();
|
||||
@ -160,7 +160,7 @@ pub fn insert_genesis_state<DB: Database>(
|
||||
|
||||
/// Inserts hashes for the genesis state.
|
||||
pub fn insert_genesis_hashes<DB: Database>(
|
||||
provider: &DatabaseProviderRW<'_, &DB>,
|
||||
provider: &DatabaseProviderRW<&DB>,
|
||||
genesis: &reth_primitives::Genesis,
|
||||
) -> ProviderResult<()> {
|
||||
// insert and hash accounts to hashing table
|
||||
@ -184,7 +184,7 @@ pub fn insert_genesis_hashes<DB: Database>(
|
||||
|
||||
/// Inserts history indices for genesis accounts and storage.
|
||||
pub fn insert_genesis_history<DB: Database>(
|
||||
provider: &DatabaseProviderRW<'_, &DB>,
|
||||
provider: &DatabaseProviderRW<&DB>,
|
||||
genesis: &reth_primitives::Genesis,
|
||||
) -> ProviderResult<()> {
|
||||
let account_transitions =
|
||||
@ -204,7 +204,7 @@ pub fn insert_genesis_history<DB: Database>(
|
||||
|
||||
/// Inserts header for the genesis state.
|
||||
pub fn insert_genesis_header<DB: Database>(
|
||||
tx: &<DB as DatabaseGAT<'_>>::TXMut,
|
||||
tx: &<DB as Database>::TXMut,
|
||||
chain: Arc<ChainSpec>,
|
||||
) -> ProviderResult<()> {
|
||||
let header = chain.sealed_genesis_header();
|
||||
@ -236,7 +236,7 @@ mod tests {
|
||||
|
||||
#[allow(clippy::type_complexity)]
|
||||
fn collect_table_entries<DB, T>(
|
||||
tx: &<DB as DatabaseGAT<'_>>::TX,
|
||||
tx: &<DB as Database>::TX,
|
||||
) -> Result<Vec<TableRow<T>>, InitDatabaseError>
|
||||
where
|
||||
DB: Database,
|
||||
|
||||
Reference in New Issue
Block a user