Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions execution/types/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,41 +191,7 @@
return o
}

func (logs Logs) FilterOld(addresses map[common.Address]struct{}, topics [][]common.Hash) Logs {
result := make(Logs, 0, len(logs))
// populate a set of addresses
Logs:
for _, log := range logs {
// empty address list means no filter
if len(addresses) > 0 {
// this is basically the includes function but done with a map
if _, ok := addresses[log.Address]; !ok {
continue
}
}
// If the to filtered topics is greater than the amount of topics in logs, skip.
if len(topics) > len(log.Topics) {
continue
}
for i, sub := range topics {
match := len(sub) == 0 // empty rule set == wildcard
// iterate over the subtopics and look for any match.
for _, topic := range sub {
if log.Topics[i] == topic {
match = true
break
}
}
// there was no match, so this log is invalid.
if !match {
continue Logs
}
}
result = append(result, log)
}
return result
}

Check failure on line 194 in execution/types/log.go

View workflow job for this annotation

GitHub Actions / lint

File is not properly formatted (gofmt)
type logMarshaling struct {
Data hexutil.Bytes
BlockNumber hexutil.Uint64
Expand Down
8 changes: 4 additions & 4 deletions execution/types/log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,10 @@
if !reflect.DeepEqual(ares, v.want) {
t.Errorf("Fail %s, got %v want %v", name, ares, v.want)
}
old_res := testFLExtractAddress(v.input.FilterOld(map[common.Address]struct{}{}, v.filter))
if !reflect.DeepEqual(old_res, v.want) {
t.Errorf("Fail Old %s, got %v want %v", name, old_res, v.want)
}
old_res := testFLExtractAddress(v.input.Filter(map[common.Address]struct{}{}, v.filter, 0))
if !reflect.DeepEqual(old_res, v.want) {

Check failure on line 244 in execution/types/log_test.go

View workflow job for this annotation

GitHub Actions / lint

File is not properly formatted (gofmt)
t.Errorf("Fail Old %s, got %v want %v", name, old_res, v.want)
}
}
}

Expand Down
Loading