Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
SeHor05 committed Oct 12, 2024
1 parent 94bef70 commit c08c7ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 2 additions & 1 deletion tvm_vm/src/executor/gas/gas_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ impl Gas {

/// Set input gas to gas limit
pub fn new_gas_limit(&mut self, gas_limit: i64) {
self.gas_limit = max(0, min(gas_limit, self.gas_limit_max));
// self.gas_limit = max(0, min(gas_limit, self.gas_limit_max));
self.gas_limit = max(0, gas_limit);
self.gas_credit = 0;
self.gas_remaining += self.gas_limit - self.gas_base;
self.gas_base = self.gas_limit;
Expand Down
3 changes: 0 additions & 3 deletions tvm_vm/src/executor/gas/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ fn setgaslimit(engine: &mut Engine, gas_limit: i64) -> Status {
// ACCEPT - F800
pub fn execute_accept(engine: &mut Engine) -> Status {
engine.load_instruction(Instruction::new("ACCEPT"))?;

log::trace!(target: "tvm", "old gas, old gas limit, new gas: {:?}, {:?}, {:?}", engine.get_gas().get_gas_limit(), engine.get_gas().get_gas_limit_max(), i64::MAX);
engine.new_gas_limit(i64::MAX);
log::trace!(target: "tvm", "new gas, new gas limit, new gas: {:?}, {:?}", engine.get_gas().get_gas_limit(), engine.get_gas().get_gas_limit_max());
Ok(())
}
// Application-specific primitives - A.11; Gas-related primitives - A.11.2
Expand Down

0 comments on commit c08c7ce

Please sign in to comment.