Skip to content

Commit

Permalink
fix gas_limit unit (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-1 authored Jun 19, 2024
1 parent 89302c4 commit 27d18c4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions crates/gas/src/meter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,12 @@ impl InitiaGasMeter {
self.balance = 0.into();
let gas_used: Gas = (self.gas_limit.checked_sub(balance).unwrap() + amount)
.to_unit_round_down_with_params(&self.gas_params.txn);
let gas_limit: Gas = self
.gas_limit
.to_unit_round_down_with_params(&self.gas_params.txn);

Err(
PartialVMError::new(StatusCode::OUT_OF_GAS).with_message(format!(
"gas_limit: {}, gas_used: {}",
self.gas_limit, gas_used
)),
)
Err(PartialVMError::new(StatusCode::OUT_OF_GAS)
.with_message(format!("gas_limit: {}, gas_used: {}", gas_limit, gas_used)))
}
}
}
Expand Down

0 comments on commit 27d18c4

Please sign in to comment.