mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 05:36:46 +00:00
core: use slices.Contains
Signed-off-by: deepdring <deepdrink@icloud.com>
This commit is contained in:
parent
2dbb580f51
commit
4c16661ac2
1 changed files with 3 additions and 5 deletions
|
|
@ -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 {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
if slices.Contains(logs, log) {
|
||||
found = true
|
||||
}
|
||||
if !found {
|
||||
t.Fatalf("Log search did not return expected log (addresses: %v, topics: %v, expected log: %v)", addresses, topics, *log)
|
||||
|
|
|
|||
Loading…
Reference in a new issue