diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a4a5c671..eeb03f457 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,11 @@ This changelog format is based on [Keep a Changelog](https://keepachangelog.com/ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased](https://github.com/eth-brownie/brownie) +### Added +- Ganache 7.7.x support. + ### Fixed +- Anvil support, you can now access trace, events and return_value for anvil transactions. - Removes `eth-abi` depreciation warnings - Bump web3.py dep to support async provider in threaded applications diff --git a/brownie/network/transaction.py b/brownie/network/transaction.py index a2530b0c5..2f9738f45 100644 --- a/brownie/network/transaction.py +++ b/brownie/network/transaction.py @@ -631,7 +631,9 @@ def _get_trace(self) -> None: raise RPCRequestError("Node client does not support `debug_traceTransaction`") try: trace = web3.provider.make_request( # type: ignore - "debug_traceTransaction", (self.txid, {"disableStorage": CONFIG.mode != "console"}) + # Set enableMemory to all RPC as anvil return the memory key + "debug_traceTransaction", (self.txid, { + "disableStorage": CONFIG.mode != "console", "enableMemory": True}) ) except (requests.exceptions.Timeout, requests.exceptions.ConnectionError) as e: msg = f"Encountered a {type(e).__name__} while requesting " @@ -674,8 +676,12 @@ def _get_trace(self) -> None: if fix_gas: # handle traces where numeric values are returned as hex (Nethermind) step["gas"] = int(step["gas"], 16) - step["gasCost"] = int.from_bytes(HexBytes(step["gasCost"]), "big", signed=True) - step["pc"] = int(step["pc"], 16) + # Check if gasCost is hex before converting. + if isinstance(step["gasCost"], str): + step["gasCost"] = int.from_bytes( + HexBytes(step["gasCost"]), "big", signed=True) + if isinstance(step["pc"], str): # Check if pc is hex before converting. + step["pc"] = int(step["pc"], 16) if self.status: self._confirmed_trace(trace) diff --git a/brownie/project/build.py b/brownie/project/build.py index 23d7c29de..094d0066d 100644 --- a/brownie/project/build.py +++ b/brownie/project/build.py @@ -74,7 +74,7 @@ def _generate_revert_map(self, pcMap: Dict, source_map: Dict, language: str) -> for k, v in pcMap.items() if v["op"] in ("REVERT", "INVALID") or "jump_revert" in v ): - if "path" not in data: + if "path" not in data or data["path"] == None: continue path_str = source_map[data["path"]]