Skip to content

Commit

Permalink
Get full tracebacks on Anvil crash
Browse files Browse the repository at this point in the history
  • Loading branch information
miohtama committed Jul 11, 2024
1 parent 096071d commit fdc0487
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion eth_defi/enzyme/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"allowed_external_position_types_policy": "0x5A739da3099fd4fC954BD764099Fc000Da76D8e7",
}

#: Enzyme deployment details for Ehereum
#: Enzyme deployment details for Ethereum
#:
#: See :py:meth:`EnzymeDeployment.fetch_deployment`
#:
Expand Down
4 changes: 3 additions & 1 deletion eth_defi/provider/anvil.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ def _launch(cmd: str, **kwargs) -> tuple[psutil.Popen, list[str]]:
final_cmd_str = " ".join(cmd_list)
logger.info("Launching anvil: %s", final_cmd_str)
out = DEVNULL if sys.platform == "win32" else PIPE
return psutil.Popen(cmd_list, stdin=DEVNULL, stdout=out, stderr=out), cmd_list
env = os.environ.copy()
env["RUST_BACKTRACE"] = "1" # Get tracebacks from crashed anvil
return psutil.Popen(cmd_list, stdin=DEVNULL, stdout=out, stderr=out, env=env), cmd_list


def make_anvil_custom_rpc_request(web3: Web3, method: str, args: Optional[list] = None) -> Any:
Expand Down

0 comments on commit fdc0487

Please sign in to comment.