Skip to content

Commit

Permalink
Reverse the order of backend and is_static in gasometer (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorpaas authored Nov 7, 2023
1 parent 729f149 commit 5ec9288
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/gasometer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ pub trait Gasometer<S, H>: Sized {
fn record_stepn(
&mut self,
machine: &Machine<S>,
backend: &H,
is_static: bool,
backend: &H,
) -> Result<usize, ExitError>;
fn record_codedeposit(&mut self, len: usize) -> Result<(), ExitError>;
fn gas(&self) -> Self::Gas;
Expand All @@ -58,7 +58,7 @@ impl<S: AsMut<RuntimeState>, G> GasedMachine<S, G> {
loop {
match self
.gasometer
.record_stepn(&self.machine, handler, self.is_static)
.record_stepn(&self.machine, self.is_static, handler)
{
Ok(stepn) => {
self.machine.state.as_mut().gas = self.gasometer.gas().into();
Expand Down
2 changes: 1 addition & 1 deletion src/standard/gasometer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ impl<'config, S: AsRef<RuntimeState>, H: RuntimeBackend> GasometerT<S, H> for Ga
fn record_stepn(
&mut self,
machine: &Machine<S>,
handler: &H,
is_static: bool,
handler: &H,
) -> Result<usize, ExitError> {
self.perform(|gasometer| {
let opcode = machine.peek_opcode().ok_or(ExitException::OutOfGas)?;
Expand Down

0 comments on commit 5ec9288

Please sign in to comment.