core: use slices.Contains

Signed-off-by: deepdring <deepdrink@icloud.com>
This commit is contained in:
deepdring 2025-08-14 22:35:07 +08:00
parent 2dbb580f51
commit 4c16661ac2

View file

@ -20,6 +20,7 @@ import (
"context"
crand "crypto/rand"
"math/rand"
"slices"
"testing"
"github.com/ethereum/go-ethereum/common"
@ -74,11 +75,8 @@ func TestMatcher(t *testing.T) {
t.Fatalf("Log search error: %v", err)
}
var found bool
for _, l := range logs {
if l == log {
if slices.Contains(logs, log) {
found = true
break
}
}
if !found {
t.Fatalf("Log search did not return expected log (addresses: %v, topics: %v, expected log: %v)", addresses, topics, *log)