Skip to content

Commit

Permalink
add net_gas_used to computations
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Feb 16, 2024
1 parent 2279ec7 commit d5b4bf2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions boa/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ def __init__(self, *args, **kwargs):
self._child_pcs = []
self._contract_repr_before_revert = None

@property
def net_gas_used(self):
return max(0, self.get_gas_used() - self.get_gas_refund())

def add_child_computation(self, child_computation):
super().add_child_computation(child_computation)
# track PCs of child calls for profiling purposes
Expand Down

0 comments on commit d5b4bf2

Please sign in to comment.