Skip to content

Commit

Permalink
removed errors in testcase (ethereum#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xsharma authored Jan 3, 2022
1 parent fbd2de7 commit d51abdb
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions eth/filters/filter_system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ import (
)

var (
deadline = 5 * time.Minute
deadline = 5 * time.Minute
borLogs bool = true
)

type testBackend struct {
Expand Down Expand Up @@ -174,7 +175,7 @@ func TestBlockSubscription(t *testing.T) {
var (
db = rawdb.NewMemoryDatabase()
backend = &testBackend{db: db}
api = NewPublicFilterAPI(backend, false, deadline)
api = NewPublicFilterAPI(backend, false, deadline, borLogs)
genesis = (&core.Genesis{BaseFee: big.NewInt(params.InitialBaseFee)}).MustCommit(db)
chain, _ = core.GenerateChain(params.TestChainConfig, genesis, ethash.NewFaker(), db, 10, func(i int, gen *core.BlockGen) {})
chainEvents = []core.ChainEvent{}
Expand Down Expand Up @@ -226,7 +227,7 @@ func TestPendingTxFilter(t *testing.T) {
var (
db = rawdb.NewMemoryDatabase()
backend = &testBackend{db: db}
api = NewPublicFilterAPI(backend, false, deadline)
api = NewPublicFilterAPI(backend, false, deadline, borLogs)

transactions = []*types.Transaction{
types.NewTransaction(0, common.HexToAddress("0xb794f5ea0ba39494ce83a213fffba74279579268"), new(big.Int), 0, new(big.Int), nil),
Expand Down Expand Up @@ -281,7 +282,7 @@ func TestLogFilterCreation(t *testing.T) {
var (
db = rawdb.NewMemoryDatabase()
backend = &testBackend{db: db}
api = NewPublicFilterAPI(backend, false, deadline)
api = NewPublicFilterAPI(backend, false, deadline, borLogs)

testCases = []struct {
crit FilterCriteria
Expand Down Expand Up @@ -325,7 +326,7 @@ func TestInvalidLogFilterCreation(t *testing.T) {
var (
db = rawdb.NewMemoryDatabase()
backend = &testBackend{db: db}
api = NewPublicFilterAPI(backend, false, deadline)
api = NewPublicFilterAPI(backend, false, deadline, borLogs)
)

// different situations where log filter creation should fail.
Expand All @@ -347,7 +348,7 @@ func TestInvalidGetLogsRequest(t *testing.T) {
var (
db = rawdb.NewMemoryDatabase()
backend = &testBackend{db: db}
api = NewPublicFilterAPI(backend, false, deadline)
api = NewPublicFilterAPI(backend, false, deadline, borLogs)
blockHash = common.HexToHash("0x1111111111111111111111111111111111111111111111111111111111111111")
)

Expand All @@ -372,7 +373,7 @@ func TestLogFilter(t *testing.T) {
var (
db = rawdb.NewMemoryDatabase()
backend = &testBackend{db: db}
api = NewPublicFilterAPI(backend, false, deadline)
api = NewPublicFilterAPI(backend, false, deadline, borLogs)

firstAddr = common.HexToAddress("0x1111111111111111111111111111111111111111")
secondAddr = common.HexToAddress("0x2222222222222222222222222222222222222222")
Expand Down Expand Up @@ -486,7 +487,7 @@ func TestPendingLogsSubscription(t *testing.T) {
var (
db = rawdb.NewMemoryDatabase()
backend = &testBackend{db: db}
api = NewPublicFilterAPI(backend, false, deadline)
api = NewPublicFilterAPI(backend, false, deadline, borLogs)

firstAddr = common.HexToAddress("0x1111111111111111111111111111111111111111")
secondAddr = common.HexToAddress("0x2222222222222222222222222222222222222222")
Expand Down Expand Up @@ -670,7 +671,7 @@ func TestPendingTxFilterDeadlock(t *testing.T) {
var (
db = rawdb.NewMemoryDatabase()
backend = &testBackend{db: db}
api = NewPublicFilterAPI(backend, false, timeout)
api = NewPublicFilterAPI(backend, false, timeout, borLogs)
done = make(chan struct{})
)

Expand Down

0 comments on commit d51abdb

Please sign in to comment.