-
Notifications
You must be signed in to change notification settings - Fork 252
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Component
sol-types
What version of Alloy are you on?
v1.0.38
Operating System
macOS (Apple Silicon)
Describe the bug
An empty anonymous event can decode any other event. For example:
sol! {
event NonAnonymousLog(addres, uint256, bool);
event AnonymousLog() anonymous;
}
// Execute a transaction that emits `NonAnonymousLog(addres, uint256, bool)` and try decoding the log with `AnonymousLog`
let anonymous_log = tx.decoded_log::<AnonymousLog>(); // This will return `Some`
assert!(anonymous.is_some()); // This will not failThis does not work if the event has fields. For instance, event AnonymousLog(address) anonymous cannot decode other events. I assume this happens because the empty anonymous event has no topics and no data, so the checks are skipped, which is not the case for a non-empty event.
Not sure whether this behavior is expected or not, but it is not very clear and can cause confusion or bugs in tests.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Todo