feat: add impl From BlockExecutionOutput for ExecutionOutcome (#10507)

This commit is contained in:
nk_ysg
2024-08-26 02:25:27 +08:00
committed by GitHub
parent dfcfe8d271
commit 5254f16e07
7 changed files with 33 additions and 44 deletions

View File

@ -45,7 +45,7 @@ mod task;
pub use crate::client::AutoSealClient;
pub use mode::{FixedBlockTimeMiner, MiningMode, ReadyTransactionMiner};
use reth_evm::execute::{BlockExecutionOutput, BlockExecutorProvider, Executor};
use reth_evm::execute::{BlockExecutorProvider, Executor};
pub use task::MiningTask;
/// A consensus implementation intended for local development and testing purposes.
@ -374,19 +374,10 @@ impl StorageInner {
);
// execute the block
let BlockExecutionOutput {
state,
receipts,
requests: block_execution_requests,
gas_used,
..
} = executor.executor(&mut db).execute((&block, U256::ZERO).into())?;
let execution_outcome = ExecutionOutcome::new(
state,
receipts.into(),
block.number,
vec![block_execution_requests.into()],
);
let block_execution_output =
executor.executor(&mut db).execute((&block, U256::ZERO).into())?;
let gas_used = block_execution_output.gas_used;
let execution_outcome = ExecutionOutcome::from((block_execution_output, block.number));
// todo(onbjerg): we should not pass requests around as this is building a block, which
// means we need to extract the requests from the execution output and compute the requests