Skip to content

Commit

Permalink
Refactored skipped-match and clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
mrLSD committed May 27, 2024
1 parent 2a1b62d commit 0f39236
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 10 deletions.
1 change: 1 addition & 0 deletions benches/loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fn run_loop_contract() {

let vicinity = MemoryVicinity {
gas_price: U256::zero(),
effective_gas_price: U256::zero(),
origin: H160::default(),
block_hashes: Vec::new(),
block_number: Default::default(),
Expand Down
7 changes: 1 addition & 6 deletions evm-tests/jsontests/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,5 @@ fn should_skip(path: &Path) -> bool {
|| Path::new(dir_name) == Path::new(case)
};

for case in SKIPPED_CASES {
if matches(case) {
return true;
}
}
false
SKIPPED_CASES.iter().any(|case| matches(case))
}
2 changes: 1 addition & 1 deletion evm-tests/jsontests/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ fn test_run(
data_max_fee,
);
if let Err(err) = &valid_tx {
if check_validate_exit_reason(err, &state.expect_exception, format!("{name}")) {
if check_validate_exit_reason(err, &state.expect_exception, name.to_string()) {
continue;
}
}
Expand Down
1 change: 0 additions & 1 deletion evm-tests/jsontests/tests/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ fn short_test_file_name(name: &str) -> String {

pub fn run(dir: &str) {
const SPEC: Option<ForkSpec> = Some(ForkSpec::Cancun);
//const SPEC: Option<ForkSpec> = Some(ForkSpec::Shanghai);

let _ = env_logger::try_init();

Expand Down
4 changes: 2 additions & 2 deletions runtime/src/eval/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pub fn base_fee<H: Handler>(runtime: &mut Runtime, handler: &H) -> Control<H> {
/// EIP-7516: BLOBBASEFEE opcode
pub fn blob_base_fee<H: Handler>(runtime: &mut Runtime, handler: &H) -> Control<H> {
// TODOFEE
println!("blob_base_fee");
// println!("blob_base_fee");
let blob_base_fee = U256::from(handler.blob_base_fee().unwrap_or_default());
push_u256!(runtime, blob_base_fee);
Control::Continue
Expand Down Expand Up @@ -127,7 +127,7 @@ pub fn blob_hash<H: Handler>(runtime: &mut Runtime, handler: &H) -> Control<H> {
// - https://eips.ethereum.org/EIPS/eip-4844#opcode-to-get-versioned-hashes
let blob_hash = handler.get_blob_hash(index).unwrap_or(U256::zero());
// TODOFEE
println!("\tset blob_hash: {blob_hash}");
// println!("\tset blob_hash: {blob_hash}");
// Set top stack index with `blob_hash` value
if let Err(e) = runtime.machine.stack_mut().set(0, blob_hash) {
return Control::Exit(e.into());
Expand Down
1 change: 1 addition & 0 deletions src/backend/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ impl<'vicinity> MemoryBackend<'vicinity> {
}

impl<'vicinity> Backend for MemoryBackend<'vicinity> {
#[allow(clippy::misnamed_getters)]
fn gas_price(&self) -> U256 {
self.vicinity.effective_gas_price
}
Expand Down

0 comments on commit 0f39236

Please sign in to comment.