-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Fixes issue #336 #371
base: main
Are you sure you want to change the base?
Fixes issue #336 #371
Conversation
Hey, thanks for participating in the bug bounty (for #336). Please share your payment address / ada handle while I will review your contribution and provide feedback. Payments will be done if the PR results in a merge. More details as usual can be found in the bug bounty documentation. |
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.
Please incorporate the noted changes. Please also run the code on two example contracts and provide the output with that (I think creating a proper unit test for logged warnings would be beyond the scope of this PR)
warn_assert_msg = f" (see assert with message '{node.msg.value}')" | ||
except Exception: | ||
warn_assert_msg = "" | ||
if isinstance(ta.test.args[0], Constant) and ta.test.args[0].value is None: |
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.
If I understand correctly you are trying to cover two cases here: either the line is assert None
or the line is assert foo()
where foo returns None.
I think it is good to explicitly cover the foo case and provide a more specific error message for it. However the handling would be more generic if after that check we check for the type of the whole expression (I.e. ta.test.args[0].typ or ta.test.typ)
Picking up on this again, I made the Exception more specific, and added two examples which give the following warnings:
Regarding your comment on more generic handling: I'm not sure if I understand what you mean by the |
Requesting bug bounty :-)