aboutsummaryrefslogtreecommitdiffstats
path: root/eth/filters
diff options
context:
space:
mode:
Diffstat (limited to 'eth/filters')
-rw-r--r--eth/filters/filter_system_test.go11
-rw-r--r--eth/filters/filter_test.go6
2 files changed, 8 insertions, 9 deletions
diff --git a/eth/filters/filter_system_test.go b/eth/filters/filter_system_test.go
index d9c245a85..822580b56 100644
--- a/eth/filters/filter_system_test.go
+++ b/eth/filters/filter_system_test.go
@@ -72,12 +72,11 @@ func TestBlockSubscription(t *testing.T) {
t.Parallel()
var (
- mux = new(event.TypeMux)
- db, _ = ethdb.NewMemDatabase()
- backend = &testBackend{mux, db}
- api = NewPublicFilterAPI(backend, false)
-
- genesis = core.WriteGenesisBlockForTesting(db)
+ mux = new(event.TypeMux)
+ db, _ = ethdb.NewMemDatabase()
+ backend = &testBackend{mux, db}
+ api = NewPublicFilterAPI(backend, false)
+ genesis = new(core.Genesis).MustCommit(db)
chain, _ = core.GenerateChain(params.TestChainConfig, genesis, db, 10, func(i int, gen *core.BlockGen) {})
chainEvents = []core.ChainEvent{}
)
diff --git a/eth/filters/filter_test.go b/eth/filters/filter_test.go
index c2dc2b842..cd5e7cafd 100644
--- a/eth/filters/filter_test.go
+++ b/eth/filters/filter_test.go
@@ -60,7 +60,7 @@ func BenchmarkMipmaps(b *testing.B) {
)
defer db.Close()
- genesis := core.WriteGenesisBlockForTesting(db, core.GenesisAccount{Address: addr1, Balance: big.NewInt(1000000)})
+ genesis := core.GenesisBlockForTesting(db, addr1, big.NewInt(1000000))
chain, receipts := core.GenerateChain(params.TestChainConfig, genesis, db, 100010, func(i int, gen *core.BlockGen) {
var receipts types.Receipts
switch i {
@@ -112,7 +112,7 @@ func BenchmarkMipmaps(b *testing.B) {
for i := 0; i < b.N; i++ {
logs, _ := filter.Find(context.Background())
if len(logs) != 4 {
- b.Fatal("expected 4 log, got", len(logs))
+ b.Fatal("expected 4 logs, got", len(logs))
}
}
}
@@ -138,7 +138,7 @@ func TestFilters(t *testing.T) {
)
defer db.Close()
- genesis := core.WriteGenesisBlockForTesting(db, core.GenesisAccount{Address: addr, Balance: big.NewInt(1000000)})
+ genesis := core.GenesisBlockForTesting(db, addr, big.NewInt(1000000))
chain, receipts := core.GenerateChain(params.TestChainConfig, genesis, db, 1000, func(i int, gen *core.BlockGen) {
var receipts types.Receipts
switch i {