Skip to content

Commit

Permalink
fix bytes eq/ne check
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandotsmith committed Aug 9, 2024
1 parent 69e8e05 commit 0648522
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dig/dig.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ func (f Filter) Accept(ctx context.Context, pgmut *sync.Mutex, pg wpg.Conn, d an
frs.add(res)
case f.Op == "eq" || f.Op == "ne":
for i := range f.Arg {
if bytes.Contains(v, eth.DecodeHex(f.Arg[i])) {
if bytes.Equal(v, eth.DecodeHex(f.Arg[i])) {
res = true
break
}
Expand Down
5 changes: 5 additions & 0 deletions dig/dig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,11 @@ func TestFilter(t *testing.T) {
"bar",
true,
},
{
Filter{Op: "eq", Arg: []string{""}},
[]byte{0x00, 0x01, 0x02},
false,
},
}
for _, c := range cases {
frs := filterResults{}
Expand Down

0 comments on commit 0648522

Please sign in to comment.