Skip to content

Commit

Permalink
fix stamps (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
crosschainer authored May 21, 2024
1 parent cae61fe commit 9889087
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/contracting/execution/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def execute(self, sender, contract_name, function_name, kwargs,

# TODO: Why do we do this?
# Multiply stamps by 1000 because we divide by it later
runtime.rt.set_up(stmps=stamps * 1000, meter=metering)
# runtime.rt.set_up(stmps=stamps * 1000, meter=metering)

runtime.rt.context._base_state = {
'signer': sender,
Expand Down Expand Up @@ -124,7 +124,9 @@ def execute(self, sender, contract_name, function_name, kwargs,
kwargs[k] = ContractingDecimal(str(v))

enable_restricted_imports()
runtime.rt.set_up(stmps=stamps * 1000, meter=metering)
result = func(**kwargs)
runtime.rt.tracer.stop()
disable_restricted_imports()

if auto_commit:
Expand All @@ -137,7 +139,7 @@ def execute(self, sender, contract_name, function_name, kwargs,
if auto_commit:
driver.flush_cache()

runtime.rt.tracer.stop()
#runtime.rt.tracer.stop()

# Deduct the stamps if that is enabled
stamps_used = runtime.rt.tracer.get_stamp_used()
Expand Down

0 comments on commit 9889087

Please sign in to comment.