-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[isoltest] Add support for events using call side-effects. #11050
Conversation
e26dc56
to
1d14a4d
Compare
171cfd0
to
3c35244
Compare
3c35244
to
f5f8c0a
Compare
ed7e535
to
ca5a695
Compare
ca5a695
to
2f27704
Compare
test/libsolidity/semanticTests/externalContracts/deposit_contract.sol
Outdated
Show resolved
Hide resolved
Please try to parse the errors and display them nicely. If this is more than a day's work, then at least try to display the error signature instead of its hash and split the data by chunks of 0x20 bytes and format them as "unknown data". |
a4b4748
to
fa2a297
Compare
2f27704
to
c212b23
Compare
4edfe0f
to
f493277
Compare
ecc9c36
to
de49d4a
Compare
ecdb3ee
to
4acc2b2
Compare
@cameel Thanks for your review! I think I covered everything, except the actual parameter decoding. It should not be that complicated, but I will add this tomorrow. |
OK. I'll take another look today. From what I've seen yesterday, most of the issues I found were cosmetic so this should be quick. If the decoding turns out to be time-consuming, feel free to just skip it in this PR. It's just nice to have, not anything critical. |
test/libsolidity/semanticTests/events/event_anonymous_with_signature_collision.sol
Show resolved
Hide resolved
test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol
Outdated
Show resolved
Hide resolved
Reviewed again, including the older comments. All of those older ones seem solved or irrelevant. So the remaining things (apart from some minor tweaks) are:
|
4acc2b2
to
b67d7eb
Compare
@cameel I added a very simple parameter decoder. I tried to implement a more advanced decoder, but it would take more time to implement this completely. Right now it only uses the parameter types for indexed/nonIndexed events for simple However, at least we have the parameter type information available, so if needed we could improve the decoding in another PR. |
I just saw that |
test/libsolidity/util/SoltestTypes.h
Outdated
LogRecord(util::h160 _creator, bytes _data, std::vector<util::h256> _topics) | ||
: creator(_creator), data(std::move(_data)), topics(std::move(_topics)) {} |
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.
LogRecord(util::h160 _creator, bytes _data, std::vector<util::h256> _topics) | |
: creator(_creator), data(std::move(_data)), topics(std::move(_topics)) {} | |
LogRecord(util::h160 _creator, bytes _data, std::vector<util::h256> _topics): | |
creator(_creator), data(std::move(_data)), topics(std::move(_topics)) {} |
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.
Why don't you move the creator? Also do you really need a constructor or would {}
-constructing be enough?
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 was also wondering why the constructor is needed, but it seem to be needed.
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.
It's because of the logs.emplace_back()
call in ExecutionFramework::recordedLogs()
. Apparently it tries to execute LogRecord()
rather than LogRecord{}
and a struct does not have the former. This is supposed to change in C++20 from what I've read.
So we could leave it as is or do logs.push_back({x, y, z ...})
instead which will allow us to remove the constructor.
Why don't you move the creator?
I wanted to point that out originally but then noticed that creator
is h160
, which is FixedHash
, which is std::array
so there's no benefit from moving it. It being const&
parameter would make more sense.
Maybe just change the string in snark.sol, we can think about a better solution later. |
b67d7eb
to
3755373
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.
Looks fine now. I have two small suggestions and you need to update gas cost in snark.sol
but other than that I think we're done here.
3755373
to
038c714
Compare
038c714
to
85e3fcb
Compare
Fixes #6902.