diff options
author | Péter Szilágyi <peterke@gmail.com> | 2018-07-12 22:36:07 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-07-12 23:16:54 +0800 |
commit | e1f1d3085c6b868de93313700cac8a325e9b148b (patch) | |
tree | b5a2c834735e0a1405a975d3552df07aebe0e2e0 /eth/filters/filter_test.go | |
parent | 96339daf40989072ff2a9e8b476da6698da45dc7 (diff) | |
download | dexon-e1f1d3085c6b868de93313700cac8a325e9b148b.tar dexon-e1f1d3085c6b868de93313700cac8a325e9b148b.tar.gz dexon-e1f1d3085c6b868de93313700cac8a325e9b148b.tar.bz2 dexon-e1f1d3085c6b868de93313700cac8a325e9b148b.tar.lz dexon-e1f1d3085c6b868de93313700cac8a325e9b148b.tar.xz dexon-e1f1d3085c6b868de93313700cac8a325e9b148b.tar.zst dexon-e1f1d3085c6b868de93313700cac8a325e9b148b.zip |
accounts, eth, les: blockhash based filtering on all code paths
Diffstat (limited to 'eth/filters/filter_test.go')
-rw-r--r-- | eth/filters/filter_test.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/eth/filters/filter_test.go b/eth/filters/filter_test.go index ccabe955c..396a03d61 100644 --- a/eth/filters/filter_test.go +++ b/eth/filters/filter_test.go @@ -92,7 +92,7 @@ func BenchmarkFilters(b *testing.B) { } b.ResetTimer() - filter := New(backend, 0, -1, []common.Address{addr1, addr2, addr3, addr4}, nil) + filter := NewRangeFilter(backend, 0, -1, []common.Address{addr1, addr2, addr3, addr4}, nil) for i := 0; i < b.N; i++ { logs, _ := filter.Logs(context.Background()) @@ -175,14 +175,14 @@ func TestFilters(t *testing.T) { rawdb.WriteReceipts(db, block.Hash(), block.NumberU64(), receipts[i]) } - filter := New(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}}) logs, _ := filter.Logs(context.Background()) if len(logs) != 4 { t.Error("expected 4 log, got", len(logs)) } - filter = New(backend, 900, 999, []common.Address{addr}, [][]common.Hash{{hash3}}) + filter = NewRangeFilter(backend, 900, 999, []common.Address{addr}, [][]common.Hash{{hash3}}) logs, _ = filter.Logs(context.Background()) if len(logs) != 1 { t.Error("expected 1 log, got", len(logs)) @@ -191,7 +191,7 @@ func TestFilters(t *testing.T) { t.Errorf("expected log[0].Topics[0] to be %x, got %x", hash3, logs[0].Topics[0]) } - filter = New(backend, 990, -1, []common.Address{addr}, [][]common.Hash{{hash3}}) + filter = NewRangeFilter(backend, 990, -1, []common.Address{addr}, [][]common.Hash{{hash3}}) logs, _ = filter.Logs(context.Background()) if len(logs) != 1 { t.Error("expected 1 log, got", len(logs)) @@ -200,7 +200,7 @@ func TestFilters(t *testing.T) { t.Errorf("expected log[0].Topics[0] to be %x, got %x", hash3, logs[0].Topics[0]) } - filter = New(backend, 1, 10, nil, [][]common.Hash{{hash1, hash2}}) + filter = NewRangeFilter(backend, 1, 10, nil, [][]common.Hash{{hash1, hash2}}) logs, _ = filter.Logs(context.Background()) if len(logs) != 2 { @@ -208,7 +208,7 @@ func TestFilters(t *testing.T) { } failHash := common.BytesToHash([]byte("fail")) - filter = New(backend, 0, -1, nil, [][]common.Hash{{failHash}}) + filter = NewRangeFilter(backend, 0, -1, nil, [][]common.Hash{{failHash}}) logs, _ = filter.Logs(context.Background()) if len(logs) != 0 { @@ -216,14 +216,14 @@ func TestFilters(t *testing.T) { } failAddr := common.BytesToAddress([]byte("failmenow")) - filter = New(backend, 0, -1, []common.Address{failAddr}, nil) + filter = NewRangeFilter(backend, 0, -1, []common.Address{failAddr}, nil) logs, _ = filter.Logs(context.Background()) if len(logs) != 0 { t.Error("expected 0 log, got", len(logs)) } - filter = New(backend, 0, -1, nil, [][]common.Hash{{failHash}, {hash1}}) + filter = NewRangeFilter(backend, 0, -1, nil, [][]common.Hash{{failHash}, {hash1}}) logs, _ = filter.Logs(context.Background()) if len(logs) != 0 { |