mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
feat(reth-evm-ethereum): use EVMError::map_db_err (#10916)
Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
This commit is contained in:
@ -28,7 +28,7 @@ use reth_revm::{
|
||||
};
|
||||
use revm_primitives::{
|
||||
db::{Database, DatabaseCommit},
|
||||
BlockEnv, CfgEnvWithHandlerCfg, EVMError, EnvWithHandlerCfg, ResultAndState,
|
||||
BlockEnv, CfgEnvWithHandlerCfg, EnvWithHandlerCfg, ResultAndState,
|
||||
};
|
||||
use std::{collections::hash_map::Entry, fmt::Display, sync::Arc};
|
||||
use tracing::trace;
|
||||
@ -186,13 +186,7 @@ where
|
||||
|
||||
// Execute transaction.
|
||||
let ResultAndState { result, state } = evm.transact().map_err(move |err| {
|
||||
let new_err = match err {
|
||||
EVMError::Transaction(e) => EVMError::Transaction(e),
|
||||
EVMError::Header(e) => EVMError::Header(e),
|
||||
EVMError::Database(e) => EVMError::Database(e.into()),
|
||||
EVMError::Custom(e) => EVMError::Custom(e),
|
||||
EVMError::Precompile(e) => EVMError::Precompile(e),
|
||||
};
|
||||
let new_err = err.map_db_err(|e| e.into());
|
||||
// Ensure hash is calculated for error log, if not already done
|
||||
BlockValidationError::EVM {
|
||||
hash: transaction.recalculate_hash(),
|
||||
|
||||
Reference in New Issue
Block a user