From 7de8fc4d37d5b11f2c5758732a2d10c40a02bad7 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Sun, 17 Nov 2024 00:55:25 -0400 Subject: [PATCH] fix: key error (#285) * fix: key error * chore: `black .` --------- Co-authored-by: github-actions[bot] --- dank_mids/brownie_patch/contract.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dank_mids/brownie_patch/contract.py b/dank_mids/brownie_patch/contract.py index 1bedf1dc..7f3af652 100644 --- a/dank_mids/brownie_patch/contract.py +++ b/dank_mids/brownie_patch/contract.py @@ -206,14 +206,14 @@ def __get_method_object__(self, name: str) -> DankContractMethod: from dank_mids import web3 overloaded = self.__method_names__.count(name) > 1 - + for abi in self.abi: - if abi["function"] != "function" or abi["name"] != name: + if abi["type"] != "function" or abi["name"] != name: continue - + full_name = f"{self._name}.{name}" sig = build_function_signature(abi) - + natspec: Dict[str, Any] = {} if self._build.get("natspec"): natspec = self._build["natspec"]["methods"].get(sig, {}) @@ -224,9 +224,9 @@ def __get_method_object__(self, name: str) -> DankContractMethod: # special logic to handle function overloading elif overloaded is True: overloaded = DankOverloadedMethod(self.address, full_name, self._owner) - + overloaded._add_fn(abi, natspec) - + return overloaded # type: ignore [return-value]