Skip to content

Commit

Permalink
chore: sort imports
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes committed Mar 28, 2024
1 parent b379fea commit a1e8052
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 25 deletions.
10 changes: 4 additions & 6 deletions src/database.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::str::FromStr;
use std::sync::Arc;

use crate::empty_db_wrapper::EmptyDBWrapper;
use crate::utils::pyerr;
use ethers_core::types::BlockId;
use ethers_providers::{Http, Provider};
use pyo3::{PyErr, PyResult};
Expand All @@ -10,9 +9,8 @@ use revm::primitives::{AccountInfo, Bytecode, HashMap, State};
use revm::Database;
use revm_interpreter::primitives::db::{DatabaseCommit, DatabaseRef};
use ruint::aliases::U256;

use crate::empty_db_wrapper::EmptyDBWrapper;
use crate::utils::pyerr;
use std::str::FromStr;
use std::sync::Arc;

type MemDB = CacheDB<EmptyDBWrapper>;
type ForkDB = CacheDB<EthersDB<Provider<Http>>>;
Expand Down
22 changes: 10 additions & 12 deletions src/evm.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
use std::collections::{HashMap, HashSet};
use std::fmt::Debug;
use std::mem::replace;

use crate::database::DB;
use crate::executor::call_evm;
use crate::types::{PyByteVec, PyDB};
use crate::{
types::{AccountInfo, BlockEnv, Env, ExecutionResult, JournalCheckpoint},
utils::{addr, pyerr},
};
use pyo3::exceptions::{PyKeyError, PyOverflowError};
use pyo3::types::PyBytes;
use pyo3::{pyclass, pymethods, PyObject, PyResult, Python};
Expand All @@ -12,16 +15,11 @@ use revm::primitives::{
HandlerCfg, Output, SpecId, TransactTo, TxEnv,
};
use revm::{primitives::U256, Evm, EvmContext, JournalCheckpoint as RevmCheckpoint};
use std::collections::{HashMap, HashSet};
use std::fmt::Debug;
use std::mem::replace;
use tracing::trace;

use crate::database::DB;
use crate::executor::call_evm;
use crate::types::{PyByteVec, PyDB};
use crate::{
types::{AccountInfo, BlockEnv, Env, ExecutionResult, JournalCheckpoint},
utils::{addr, pyerr},
};

#[derive(Debug)]
#[pyclass]
pub struct EVM {
Expand Down
8 changes: 3 additions & 5 deletions src/executor.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::mem::replace;

use crate::database::DB;
use crate::utils::pyerr;
use pyo3::exceptions::PyRuntimeError;
use pyo3::PyResult;
use revm::inspectors::TracerEip3155;
Expand All @@ -12,9 +12,7 @@ use revm::{
};
use revm_interpreter::primitives::HandlerCfg;
use revm_interpreter::{gas, CallInputs, CreateInputs, SuccessOrHalt};

use crate::database::DB;
use crate::utils::pyerr;
use std::mem::replace;

/// Calls the EVM with the given context and handler configuration.
pub(crate) fn call_evm(
Expand Down
3 changes: 1 addition & 2 deletions src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use std::fmt::Debug;

use pyo3::exceptions::PyRuntimeError;
use pyo3::{exceptions::PyTypeError, prelude::*};
use revm::primitives::Address;
use std::fmt::Debug;

pub(crate) fn addr(s: &str) -> Result<Address, PyErr> {
s.parse::<Address>()
Expand Down

0 comments on commit a1e8052

Please sign in to comment.