Skip to content

Commit

Permalink
fix: wrong value
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Aug 20, 2024
1 parent baf7a1c commit 9850d08
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ape/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def __init__(
contract_address: Optional["AddressType"] = None,
source_traceback: _SOURCE_TRACEBACK_ARG = None,
project: Optional["ProjectManager"] = None,
set_ape_traceback: bool = False, # Overriden in ContractLogicError
set_ape_traceback: bool = False, # Overridden in ContractLogicError
):
message = message or (str(base_err) if base_err else self.DEFAULT_MESSAGE)
self.message = message
Expand Down
7 changes: 5 additions & 2 deletions src/ape_ethereum/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ def return_value(self) -> Any:
# Barely enrich a calltree for performance reasons
# (likely not a need to enrich the whole thing).
calltree = self.get_raw_calltree()
enriched_return = self._ecosystem._enrich_returndata(calltree, abi)
return enriched_return["returndata"]
enriched_calltree = self._ecosystem._enrich_returndata(calltree, abi)
return self._get_return_value_from_calltree(enriched_calltree)

return self._return_value_from_enriched_calltree

Expand All @@ -252,6 +252,9 @@ def _return_value_from_enriched_calltree(self) -> Any:
if "return_value" in self.__dict__:
return self.__dict__["return_value"]

return self._get_return_value_from_calltree(calltree)

def _get_return_value_from_calltree(self, calltree: dict) -> Any:
# If enriching too much, Ethereum places regular values in a key
# named "unenriched_return_values".
if "unenriched_return_values" in calltree:
Expand Down

0 comments on commit 9850d08

Please sign in to comment.