-
Notifications
You must be signed in to change notification settings - Fork 493
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
Goal: Warn on invalid method signature assembly #3614
Conversation
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.
LGTM
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.
Looks good. Let's do something similar for "event" (after spending a little time defining it), and then a bare selector
pseudo-op. Once we have those, I think this would becomes an error rather than warning.
Why did you have to suppress printing, rather than separating assembly output from earnings by using stderr?
Codecov Report
@@ Coverage Diff @@
## master #3614 +/- ##
==========================================
- Coverage 49.88% 49.84% -0.04%
==========================================
Files 392 392
Lines 68685 68713 +28
==========================================
- Hits 34264 34251 -13
- Misses 30669 30706 +37
- Partials 3752 3756 +4
Continue to review full report at Codecov.
|
Originally I just used the same convention for warnings as other places in goal, which is to print to stdout. But I agree this seems odd, so I now changed it so that all warnings go to stderr for goal commands. This is a little more far reaching than I intended, so I hope it doesn't disrupt anything else. |
Hey folks, I was just reviewing this PR again and was wondering about what JJ previously mentioned:
What is "event" referring to, does that mean another op/pseudo-op? |
An "event" in ethereum is a structured message that a contract can emit. Our |
Uh I see, thanks for explaining! I was also reading: https://medium.com/mycrypto/understanding-event-logs-on-the-ethereum-blockchain-f4ae7ba50378, seems matching what you just mentioned. I suppose this "event" sounds like a "structured log", which allows for some structured fields filled by ABI encodings, and it might worth it to check the validity of those fields, just like this PR. |
3f8f89f
to
471d61e
Compare
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.
Seems good. Merging.
Summary
With this PR, the assembler will now warn if an invalid method signature is used as an argument to the
method
pseudo-op. This is just a warning so the program will still compile, but it should help users be aware of mistakes they might have made.No urgency to this PR.
Example
test.teal:
Test Plan
Unit test added.