mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
chore(executor): add tx hash to evm error (#1714)
This commit is contained in:
@ -376,12 +376,13 @@ where
|
||||
// Fill revm structure.
|
||||
fill_tx_env(&mut self.evm.env.tx, transaction, sender);
|
||||
|
||||
let out = if self.stack.should_inspect(&self.evm.env, transaction.hash()) {
|
||||
let hash = transaction.hash();
|
||||
let out = if self.stack.should_inspect(&self.evm.env, hash) {
|
||||
// execution with inspector.
|
||||
let output = self.evm.inspect(&mut self.stack);
|
||||
tracing::trace!(
|
||||
target: "evm",
|
||||
hash = ?transaction.hash(), ?output, ?transaction, env = ?self.evm.env,
|
||||
?hash, ?output, ?transaction, env = ?self.evm.env,
|
||||
"Executed transaction"
|
||||
);
|
||||
output
|
||||
@ -389,7 +390,7 @@ where
|
||||
// main execution.
|
||||
self.evm.transact()
|
||||
};
|
||||
out.map_err(|e| Error::EVM(format!("{e:?}")))
|
||||
out.map_err(|e| Error::EVM { hash, message: format!("{e:?}") })
|
||||
}
|
||||
|
||||
/// Runs the provided transactions and commits their state. Will proceed
|
||||
|
||||
@ -5,8 +5,8 @@ use thiserror::Error;
|
||||
#[allow(missing_docs)]
|
||||
#[derive(Error, Debug, Clone, PartialEq, Eq)]
|
||||
pub enum Error {
|
||||
#[error("EVM reported invalid transaction:{0}")]
|
||||
EVM(String),
|
||||
#[error("EVM reported invalid transaction ({hash:?}): {message}")]
|
||||
EVM { hash: H256, message: String },
|
||||
#[error("Example of error.")]
|
||||
VerificationFailed,
|
||||
#[error("Fatal internal error")]
|
||||
|
||||
Reference in New Issue
Block a user