Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
ABI parser #115
ABI parser #115
Changes from 1 commit
aaec072
d7d6e88
732ad98
b627c5e
4bffa6b
e73ecf5
14f0d67
770b0c6
d89d066
c6f563f
ec63bde
71058ad
bf97f44
94566a4
41338d5
40ead39
5b04c54
b29150f
e60dec2
2783627
b99e305
2ca7e30
df89803
2071ae6
3a387c4
fad49f3
0f7e776
795cf13
fcbff5c
f6cb339
d0ce26c
a91735d
13b873d
3130ce3
20cac2d
6f3fea7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't really like the truthy uses here. actually it seems the issue is that abi decoding could fail, right? can we skip this check and then just catch the exception from
abi_decode()
a few lines down? that would handle other abi decoding errors too, not sure if that's a good thing or not.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to raise proper errors when there is no bytecode deployed in that address.
This test:
titanoboa/tests/integration/fork/test_abi_contract.py
Line 51 in 2ca7e30
If we don't do this here, you get a
DecodeError: Error decoding '0x' as '(uint8)' - Value length is not the expected size of 32 bytes
- which gives no information to the user.With this check the error changes to
BoaError: (unknown location in <crvusd_abi.json interface at 0x0000000000000000000000000000000000000000 (WARNING: no bytecode at this address!)> crvusd_abi.decimals() -> ['uint8'])
I think using truthy here makes sense, since it doesn't matter whether
abi_type
/computation.output
areNone
or''