Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a try block around ABI loading for Foundry projects #11

Merged
merged 2 commits into from
Mar 8, 2024

Conversation

zomglings
Copy link
Contributor

A user reported an issue loading a Foundry project:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/bin/inspector-facet", line 8, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/inspector_facet/cli.py", line 161, in main
    abis = foundry_project_abis(args.project, args.build_dir)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/inspector_facet/abi.py", line 76, in foundry_project_abis
    contract_abi = contract_artifact.get("abi", [])
AttributeError: 'list' object has no attribute 'get'

In this PR, I wrap the contract_artifact.get("abi", []) call in a try block. This is an exploratory change.

A user reported an issue loading a Foundry project:

```
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/bin/inspector-facet", line 8, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/inspector_facet/cli.py", line 161, in main
    abis = foundry_project_abis(args.project, args.build_dir)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/inspector_facet/abi.py", line 76, in foundry_project_abis
    contract_abi = contract_artifact.get("abi", [])
AttributeError: 'list' object has no attribute 'get'
```

In this PR, I wrap the `contract_artifact.get("abi", [])` call in a try block. This is an exploratory change.
@zomglings zomglings merged commit 6b18bdb into main Mar 8, 2024
@zomglings zomglings deleted the fix-foundry-abi-load branch March 8, 2024 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant