Skip to content

Commit

Permalink
chore: Remove Host constrain from calc_call_gas (#1409)
Browse files Browse the repository at this point in the history
* chore: Remove Host constrain from calc_call_gas

* make it build
  • Loading branch information
rakita authored May 13, 2024
1 parent a04c7cd commit 919aae5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions crates/interpreter/src/instructions/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ pub fn call<H: Host + ?Sized, SPEC: Spec>(interpreter: &mut Interpreter, host: &
interpreter.instruction_result = InstructionResult::FatalExternalError;
return;
};
let Some(mut gas_limit) = calc_call_gas::<H, SPEC>(
let Some(mut gas_limit) = calc_call_gas::<SPEC>(
interpreter,
is_cold,
has_transfer,
Expand Down Expand Up @@ -520,7 +520,7 @@ pub fn call_code<H: Host + ?Sized, SPEC: Spec>(interpreter: &mut Interpreter, ho
return;
};

let Some(mut gas_limit) = calc_call_gas::<H, SPEC>(
let Some(mut gas_limit) = calc_call_gas::<SPEC>(
interpreter,
is_cold,
value != U256::ZERO,
Expand Down Expand Up @@ -571,7 +571,7 @@ pub fn delegate_call<H: Host + ?Sized, SPEC: Spec>(interpreter: &mut Interpreter
return;
};
let Some(gas_limit) =
calc_call_gas::<H, SPEC>(interpreter, is_cold, false, false, local_gas_limit)
calc_call_gas::<SPEC>(interpreter, is_cold, false, false, local_gas_limit)
else {
return;
};
Expand Down Expand Up @@ -613,7 +613,7 @@ pub fn static_call<H: Host + ?Sized, SPEC: Spec>(interpreter: &mut Interpreter,
};

let Some(gas_limit) =
calc_call_gas::<H, SPEC>(interpreter, is_cold, false, false, local_gas_limit)
calc_call_gas::<SPEC>(interpreter, is_cold, false, false, local_gas_limit)
else {
return;
};
Expand Down
3 changes: 1 addition & 2 deletions crates/interpreter/src/instructions/contract/call_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use crate::{
gas,
interpreter::Interpreter,
primitives::{Bytes, Spec, SpecId::*, U256},
Host,
};
use core::{cmp::min, ops::Range};

Expand Down Expand Up @@ -43,7 +42,7 @@ pub fn resize_memory_and_return_range(
}

#[inline]
pub fn calc_call_gas<H: Host + ?Sized, SPEC: Spec>(
pub fn calc_call_gas<SPEC: Spec>(
interpreter: &mut Interpreter,
is_cold: bool,
has_transfer: bool,
Expand Down

0 comments on commit 919aae5

Please sign in to comment.