Skip to content

Commit

Permalink
chore: cargo fmt.
Browse files Browse the repository at this point in the history
  • Loading branch information
TAMARA LIPOWSKI committed Oct 22, 2024
1 parent febf3fc commit 61d2493
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
12 changes: 5 additions & 7 deletions src/evm_simulation/simulation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use std::collections::HashMap;
use ethers::types::{Bytes, U256};
use foundry_config::{Chain, Config};
use foundry_evm::traces::TraceKind;
use std::fmt;
use revm::{
db::DatabaseRef,
inspector_handle_register,
Expand All @@ -15,6 +14,7 @@ use revm::{
Evm,
};
use revm_inspectors::tracing::{TracingInspector, TracingInspectorConfig};
use std::fmt;
use tokio::runtime::Runtime;
use tracing::debug;

Expand All @@ -38,12 +38,10 @@ impl fmt::Display for SimulationError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
SimulationError::StorageError(msg) => write!(f, "StorageError: {}", msg),
SimulationError::TransactionError { data, gas_used } => {
match gas_used {
Some(gas) => write!(f, "TransactionError: {} (gas used: {})", data, gas),
None => write!(f, "TransactionError: {}", data),
}
}
SimulationError::TransactionError { data, gas_used } => match gas_used {
Some(gas) => write!(f, "TransactionError: {} (gas used: {})", data, gas),
None => write!(f, "TransactionError: {}", data),
},
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/protocol/vm/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,10 @@ mod tests {
#[test]
fn test_maybe_coerce_error_no_match() {
// Test for non-revert, non-out-of-gas, non-storage errors
let err = SimulationError::TransactionError{data: "Some other error".to_string(), gas_used: None};
let err = SimulationError::TransactionError {
data: "Some other error".to_string(),
gas_used: None,
};

let result = maybe_coerce_error(err, "test_pool", None);

Expand Down

0 comments on commit 61d2493

Please sign in to comment.