|
|
@@ -85,7 +85,7 @@ func BenchmarkFilters(b *testing.B) {
|
|
|
}
|
|
|
b.ResetTimer()
|
|
|
|
|
|
- filter := NewRangeFilter(backend, 0, -1, []common.Address{addr1, addr2, addr3, addr4}, nil)
|
|
|
+ filter := NewRangeFilter(backend, 0, -1, []common.Address{addr1, addr2, addr3, addr4}, nil, false)
|
|
|
|
|
|
for i := 0; i < b.N; i++ {
|
|
|
logs, _ := filter.Logs(context.Background())
|
|
|
@@ -168,14 +168,14 @@ func TestFilters(t *testing.T) {
|
|
|
rawdb.WriteReceipts(db, block.Hash(), block.NumberU64(), receipts[i])
|
|
|
}
|
|
|
|
|
|
- filter := NewRangeFilter(backend, 0, -1, []common.Address{addr}, [][]common.Hash{{hash1, hash2, hash3, hash4}})
|
|
|
+ filter := NewRangeFilter(backend, 0, -1, []common.Address{addr}, [][]common.Hash{{hash1, hash2, hash3, hash4}}, false)
|
|
|
|
|
|
logs, _ := filter.Logs(context.Background())
|
|
|
if len(logs) != 4 {
|
|
|
t.Error("expected 4 log, got", len(logs))
|
|
|
}
|
|
|
|
|
|
- filter = NewRangeFilter(backend, 900, 999, []common.Address{addr}, [][]common.Hash{{hash3}})
|
|
|
+ filter = NewRangeFilter(backend, 900, 999, []common.Address{addr}, [][]common.Hash{{hash3}}, false)
|
|
|
logs, _ = filter.Logs(context.Background())
|
|
|
if len(logs) != 1 {
|
|
|
t.Error("expected 1 log, got", len(logs))
|
|
|
@@ -184,7 +184,7 @@ func TestFilters(t *testing.T) {
|
|
|
t.Errorf("expected log[0].Topics[0] to be %x, got %x", hash3, logs[0].Topics[0])
|
|
|
}
|
|
|
|
|
|
- filter = NewRangeFilter(backend, 990, -1, []common.Address{addr}, [][]common.Hash{{hash3}})
|
|
|
+ filter = NewRangeFilter(backend, 990, -1, []common.Address{addr}, [][]common.Hash{{hash3}}, false)
|
|
|
logs, _ = filter.Logs(context.Background())
|
|
|
if len(logs) != 1 {
|
|
|
t.Error("expected 1 log, got", len(logs))
|
|
|
@@ -193,7 +193,7 @@ func TestFilters(t *testing.T) {
|
|
|
t.Errorf("expected log[0].Topics[0] to be %x, got %x", hash3, logs[0].Topics[0])
|
|
|
}
|
|
|
|
|
|
- filter = NewRangeFilter(backend, 1, 10, nil, [][]common.Hash{{hash1, hash2}})
|
|
|
+ filter = NewRangeFilter(backend, 1, 10, nil, [][]common.Hash{{hash1, hash2}}, false)
|
|
|
|
|
|
logs, _ = filter.Logs(context.Background())
|
|
|
if len(logs) != 2 {
|
|
|
@@ -201,7 +201,7 @@ func TestFilters(t *testing.T) {
|
|
|
}
|
|
|
|
|
|
failHash := common.BytesToHash([]byte("fail"))
|
|
|
- filter = NewRangeFilter(backend, 0, -1, nil, [][]common.Hash{{failHash}})
|
|
|
+ filter = NewRangeFilter(backend, 0, -1, nil, [][]common.Hash{{failHash}}, false)
|
|
|
|
|
|
logs, _ = filter.Logs(context.Background())
|
|
|
if len(logs) != 0 {
|
|
|
@@ -209,14 +209,14 @@ func TestFilters(t *testing.T) {
|
|
|
}
|
|
|
|
|
|
failAddr := common.BytesToAddress([]byte("failmenow"))
|
|
|
- filter = NewRangeFilter(backend, 0, -1, []common.Address{failAddr}, nil)
|
|
|
+ filter = NewRangeFilter(backend, 0, -1, []common.Address{failAddr}, nil, false)
|
|
|
|
|
|
logs, _ = filter.Logs(context.Background())
|
|
|
if len(logs) != 0 {
|
|
|
t.Error("expected 0 log, got", len(logs))
|
|
|
}
|
|
|
|
|
|
- filter = NewRangeFilter(backend, 0, -1, nil, [][]common.Hash{{failHash}, {hash1}})
|
|
|
+ filter = NewRangeFilter(backend, 0, -1, nil, [][]common.Hash{{failHash}, {hash1}}, false)
|
|
|
|
|
|
logs, _ = filter.Logs(context.Background())
|
|
|
if len(logs) != 0 {
|