chore: rm unused execute function (#7513)

This commit is contained in:
Matthias Seitz
2024-04-08 19:28:17 +02:00
committed by GitHub
parent 6beb53ee10
commit 6a104cc174
4 changed files with 24 additions and 48 deletions

View File

@ -13,17 +13,6 @@ pub struct TestExecutor(pub Option<BundleStateWithReceipts>);
impl BlockExecutor for TestExecutor {
type Error = BlockExecutionError;
fn execute(
&mut self,
_block: &BlockWithSenders,
_total_difficulty: U256,
) -> Result<(), BlockExecutionError> {
if self.0.is_none() {
return Err(BlockExecutionError::UnavailableForTest)
}
Ok(())
}
fn execute_and_verify_receipt(
&mut self,
_block: &BlockWithSenders,

View File

@ -18,20 +18,18 @@ pub trait ExecutorFactory: Send + Sync + 'static {
}
/// An executor capable of executing a block.
///
/// This type is capable of executing (multiple) blocks by applying the state changes made by each
/// block. The final state of the executor can extracted using
/// [take_output_state](BlockExecutor::take_output_state).
pub trait BlockExecutor {
/// The error type returned by the executor.
type Error;
/// Execute a block.
fn execute(
&mut self,
block: &BlockWithSenders,
total_difficulty: U256,
) -> Result<(), Self::Error>;
/// Executes the block and checks receipts.
/// Executes the entire block and verifies:
/// - receipts (receipts root)
///
/// See [execute](BlockExecutor::execute) for more details.
/// This will update the state of the executor with the changes made by the block.
fn execute_and_verify_receipt(
&mut self,
block: &BlockWithSenders,
@ -49,7 +47,8 @@ pub trait BlockExecutor {
///
/// The second returned value represents the total gas used by this block of transactions.
///
/// See [execute](BlockExecutor::execute) for more details.
/// See [execute_and_verify_receipt](BlockExecutor::execute_and_verify_receipt) for more
/// details.
fn execute_transactions(
&mut self,
block: &BlockWithSenders,