diff --git a/Makefile b/Makefile index 0fceda9..d82287f 100644 --- a/Makefile +++ b/Makefile @@ -13,3 +13,7 @@ build-prod: test: build poetry run pytest -s tests/* + +lint: + cargo clippy --workspace --all-targets --all-features + cargo fmt --all diff --git a/src/evm.rs b/src/evm.rs index 8d0ddfe..936ec54 100644 --- a/src/evm.rs +++ b/src/evm.rs @@ -368,6 +368,7 @@ impl EVM { } } + #[allow(clippy::useless_asref)] fn run_env(&mut self, env: RevmEnv, is_static: bool) -> PyResult { self.context.env = Box::new(env); let evm_context: EvmContext = diff --git a/src/executor.rs b/src/executor.rs index 6c208e2..9c84100 100644 --- a/src/executor.rs +++ b/src/executor.rs @@ -2,16 +2,16 @@ use std::mem::replace; use pyo3::exceptions::PyRuntimeError; use pyo3::PyResult; -use revm::{ - Context, ContextWithHandlerCfg, Evm, EvmContext, FrameOrResult, FrameResult, - inspector_handle_register, -}; use revm::inspectors::TracerEip3155; use revm::precompile::Log; -use revm::primitives::{ExecutionResult, ShanghaiSpec}; use revm::primitives::TransactTo; -use revm_interpreter::{CallInputs, CreateInputs, gas, SuccessOrHalt}; +use revm::primitives::{ExecutionResult, ShanghaiSpec}; +use revm::{ + inspector_handle_register, Context, ContextWithHandlerCfg, Evm, EvmContext, FrameOrResult, + FrameResult, +}; use revm_interpreter::primitives::HandlerCfg; +use revm_interpreter::{gas, CallInputs, CreateInputs, SuccessOrHalt}; use crate::database::DB; use crate::utils::pyerr; @@ -51,10 +51,7 @@ pub(crate) fn call_evm( } /// Calls the given evm. This is originally a copy of revm::Evm::transact, but it calls our own output function -fn run_evm( - evm: &mut Evm<'_, EXT, DB>, - is_static: bool, -) -> PyResult { +fn run_evm(evm: &mut Evm<'_, EXT, DB>, is_static: bool) -> PyResult { let logs_i = evm.context.evm.journaled_state.logs.len(); evm.handler @@ -139,7 +136,7 @@ fn run_evm( let logs = ctx.evm.journaled_state.logs[logs_i..].to_vec(); // Returns output of transaction. - Ok(output(ctx, result, logs)?) + output(ctx, result, logs) } fn call_inputs(