Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #4271 +/- ##
==========================================
- Coverage 32.76% 32.66% -0.11%
==========================================
Files 482 483 +1
Lines 57036 57181 +145
==========================================
- Hits 18688 18678 -10
- Misses 35077 35230 +153
- Partials 3271 3273 +2 |
❌ 5 Tests Failed:
View the top 3 failed tests by shortest run time
📣 Thoughts on this report? Let Codecov know! | Powered by Codecov |
c30dcd7 to
4bb6f91
Compare
4bb6f91 to
84f9e1e
Compare
tsahee
left a comment
There was a problem hiding this comment.
overall this is looking great. Very small comments
| return NewEventFilter(config.Rules) | ||
| } | ||
|
|
||
| func NewEventFilterFromFile(path string) (*EventFilter, error) { |
There was a problem hiding this comment.
seems like this and the one above it would be better off returning just rules instead of filter and then you only create a filter once.
| } | ||
|
|
||
| // ExtractAddresses returns all addresses referenced by this event rule verbatim. | ||
| func (f *EventFilter) ExtractAddresses(topics []common.Hash, _data []byte, _emitter common.Address, _sender common.Address) []common.Address { |
There was a problem hiding this comment.
(not a must) to me the name sounds like mid-step, not suggesting that bypass is also taken into account.. maybe call it something like FilteredAddresses? .. not sure at all about that one.
There was a problem hiding this comment.
Changed to AddressesForFiltering
| } | ||
|
|
||
| // Helper function to compute selector from event signature, used for test purposes only. | ||
| func Selector4(sig string) [eventSelectorSize]byte { |
There was a problem hiding this comment.
can you use the full behavior here, which is currently implemented as part of ParseSelector? (and also use this function from parseSelector)
The extra time parsing, computing canonical etc. is not a problem for tests, and I'd rather have just one correct implementation rather then risk someone calling this function later for production code.
There was a problem hiding this comment.
Fixed + removed duplication from Validate()
| return &EventFilter{rules: m}, nil | ||
| } | ||
|
|
||
| func NewEventFilterFromConfig(cfg EventFilterConfig) (*EventFilter, error) { |
Fixes NIT-4250 and NIT-4251
In this PR: