Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSchiavini committed Dec 22, 2023
1 parent e60dec2 commit 2783627
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
17 changes: 1 addition & 16 deletions boa/contracts/abi/contract.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import warnings
from collections import Counter
from functools import cached_property
from itertools import groupby
from os.path import basename
Expand Down Expand Up @@ -99,23 +97,10 @@ def __init__(
self._filename = filename

@classmethod
def from_abi_dict(cls, abi, name: Optional[str] = None):
if name is None:
name = "<anonymous contract>"

def from_abi_dict(cls, abi, name="<anonymous contract>"):
functions = [
ABIFunction(item, name) for item in abi if item.get("type") == "function"
]

# warn on functions with same name
for function_name, count in Counter(f.name for f in functions).items():
if count > 1:
warnings.warn(
f"{name} overloads {function_name}! overloaded methods "
"might not work correctly at this time",
stacklevel=1,
)

return cls(basename(name), functions, filename=name)

def at(self, address) -> ABIContract:
Expand Down
2 changes: 1 addition & 1 deletion boa/profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def cache_gas_used_for_computation(contract, computation):
for _computation in computation.children:
child_contract = env.lookup_contract(_computation.msg.code_address)

# ignore black box contract
# ignore black box contracts
if child_contract is not None:
cache_gas_used_for_computation(child_contract, _computation)

Expand Down

0 comments on commit 2783627

Please sign in to comment.