switch to static lifetime

This commit is contained in:
Dan Cline
2024-02-13 12:03:22 -05:00
parent 9ab778daf1
commit 194b7365b2
3 changed files with 6 additions and 6 deletions

View File

@@ -40,9 +40,9 @@ impl<EvmConfig> ExecutorFactory for EvmProcessorFactory<EvmConfig>
where
EvmConfig: ConfigureEvmEnv + Send + Sync + Clone + 'static,
{
type Executor<'a> = EVMProcessor<'a, EvmConfig>;
type Executor = EVMProcessor<'static, EvmConfig>;
fn with_state<'a, SP: StateProvider + 'a>(&'a self, sp: SP) -> Self::Executor<'a> {
fn with_state<SP: StateProvider + 'static>(&self, sp: SP) -> Self::Executor {
let database_state = StateProviderDatabase::new(sp);
let mut evm = EVMProcessor::new_with_db(
self.chain_spec.clone(),

View File

@@ -70,9 +70,9 @@ impl TestExecutorFactory {
}
impl ExecutorFactory for TestExecutorFactory {
type Executor<'a> = TestExecutor;
type Executor = TestExecutor;
fn with_state<'a, SP: StateProvider + 'a>(&'a self, _sp: SP) -> Self::Executor<'a> {
fn with_state<SP: StateProvider>(&self, _sp: SP) -> Self::Executor {
let exec_res = self.exec_results.lock().pop();
TestExecutor(exec_res)
}

View File

@@ -12,10 +12,10 @@ use tracing::debug;
pub trait ExecutorFactory: Send + Sync + 'static {
/// Type of block executor to return, this must be an associated type so the executor can be
/// consumed when it's done executing.
type Executor<'a>: PrunableBlockExecutor;
type Executor: PrunableBlockExecutor;
/// Executor with [`StateProvider`]
fn with_state<'a, SP: StateProvider + 'a>(&'a self, _sp: SP) -> Self::Executor<'a>;
fn with_state<SP: StateProvider + 'static>(&self, _sp: SP) -> Self::Executor;
}
/// An executor capable of executing a block.