Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSchiavini committed May 3, 2024
1 parent 827a013 commit 726631a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ build-prod:

test: build
poetry run pytest -s tests/*

lint:
cargo clippy --workspace --all-targets --all-features
cargo fmt --all
1 change: 1 addition & 0 deletions src/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ impl EVM {
}
}

#[allow(clippy::useless_asref)]
fn run_env(&mut self, env: RevmEnv, is_static: bool) -> PyResult<RevmExecutionResult> {
self.context.env = Box::new(env);
let evm_context: EvmContext<DB> =
Expand Down
19 changes: 8 additions & 11 deletions src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<EXT>(
evm: &mut Evm<'_, EXT, DB>,
is_static: bool,
) -> PyResult<ExecutionResult> {
fn run_evm<EXT>(evm: &mut Evm<'_, EXT, DB>, is_static: bool) -> PyResult<ExecutionResult> {
let logs_i = evm.context.evm.journaled_state.logs.len();

evm.handler
Expand Down Expand Up @@ -139,7 +136,7 @@ fn run_evm<EXT>(
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<EXT>(
Expand Down

0 comments on commit 726631a

Please sign in to comment.