|
1 | | -use crate::{Block, BlockContext, EvmBlockComplete, EvmBlockDriverErrored, EvmNeedsTx}; |
| 1 | +use crate::{Block, EvmBlockDriverErrored, EvmNeedsBlock, EvmNeedsTx}; |
2 | 2 | use revm::{primitives::EVMError, Database, DatabaseCommit}; |
3 | 3 |
|
4 | 4 | /// The result of running transactions for a block driver. |
5 | | -pub type RunTxResult<'a, 'b, Ext, Db, C, T> = |
6 | | - Result<EvmNeedsTx<'a, Ext, Db, C>, EvmBlockDriverErrored<'a, 'b, Ext, Db, C, T>>; |
| 5 | +pub type RunTxResult<'a, Ext, Db, T> = |
| 6 | + Result<EvmNeedsTx<'a, Ext, Db>, EvmBlockDriverErrored<'a, Ext, Db, T>>; |
7 | 7 |
|
8 | 8 | /// The result of driving a block to completion. |
9 | | -pub type DriveBlockResult<'a, 'b, Ext, Db, C, T> = |
10 | | - Result<EvmBlockComplete<'a, Ext, Db, C>, EvmBlockDriverErrored<'a, 'b, Ext, Db, C, T>>; |
| 9 | +pub type DriveBlockResult<'a, Ext, Db, T> = |
| 10 | + Result<EvmNeedsBlock<'a, Ext, Db>, EvmBlockDriverErrored<'a, Ext, Db, T>>; |
11 | 11 |
|
12 | 12 | /// Driver for a single trevm block. This trait allows a type to specify the |
13 | 13 | /// entire lifecycle of a trevm block, from opening the block to driving the |
14 | 14 | /// trevm to completion. |
15 | | -pub trait BlockDriver<'b, Ext, C: BlockContext<Ext>> |
16 | | -where |
17 | | - Self: 'b, |
18 | | -{ |
| 15 | +pub trait BlockDriver<Ext> { |
19 | 16 | /// The [`Block`] filler for this driver. |
20 | 17 | type Block: Block; |
21 | 18 |
|
22 | 19 | /// An error type for this driver. |
23 | | - type Error<Db: Database>: std::error::Error |
24 | | - + From<EVMError<Db::Error>> |
25 | | - + From<<C as BlockContext<Ext>>::Error<Db>>; |
| 20 | + type Error<Db: Database>: std::error::Error + From<EVMError<Db::Error>>; |
26 | 21 |
|
27 | 22 | /// Get a reference to the block filler for this driver. |
28 | 23 | fn block(&self) -> &Self::Block; |
29 | 24 |
|
30 | | - /// Get the context for this block. |
31 | | - fn context(&'b self) -> C; |
32 | | - |
33 | 25 | /// Run the transactions for the block. |
34 | 26 | fn run_txns<'a, Db: Database + DatabaseCommit>( |
35 | | - &self, |
36 | | - trevm: EvmNeedsTx<'a, Ext, Db, C>, |
37 | | - ) -> RunTxResult<'a, 'b, Ext, Db, C, Self>; |
| 27 | + &mut self, |
| 28 | + trevm: EvmNeedsTx<'a, Ext, Db>, |
| 29 | + ) -> RunTxResult<'a, Ext, Db, Self>; |
38 | 30 |
|
39 | 31 | /// Run post |
40 | | - fn post_block_checks<Db: Database + DatabaseCommit>( |
41 | | - &self, |
42 | | - trevm: &EvmBlockComplete<'_, Ext, Db, C>, |
| 32 | + fn post_block<Db: Database + DatabaseCommit>( |
| 33 | + &mut self, |
| 34 | + trevm: &EvmNeedsBlock<'_, Ext, Db>, |
43 | 35 | ) -> Result<(), Self::Error<Db>>; |
44 | 36 | } |
0 commit comments