|
|
|
@ -429,7 +429,10 @@ func TestInvalidLogFilterCreation(t *testing.T) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// TestLogFilterUninstall tests invalid getLogs requests
|
|
|
|
|
func TestInvalidGetLogsRequest(t *testing.T) { |
|
|
|
|
t.Parallel() |
|
|
|
|
|
|
|
|
|
var ( |
|
|
|
|
db = rawdb.NewMemoryDatabase() |
|
|
|
|
_, sys = newTestFilterSystem(t, db, Config{}) |
|
|
|
@ -451,6 +454,21 @@ func TestInvalidGetLogsRequest(t *testing.T) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// TestInvalidGetRangeLogsRequest tests getLogs with invalid block range
|
|
|
|
|
func TestInvalidGetRangeLogsRequest(t *testing.T) { |
|
|
|
|
t.Parallel() |
|
|
|
|
|
|
|
|
|
var ( |
|
|
|
|
db = rawdb.NewMemoryDatabase() |
|
|
|
|
_, sys = newTestFilterSystem(t, db, Config{}) |
|
|
|
|
api = NewFilterAPI(sys, false) |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
if _, err := api.GetLogs(context.Background(), FilterCriteria{FromBlock: big.NewInt(2), ToBlock: big.NewInt(1)}); err != errInvalidBlockRange { |
|
|
|
|
t.Errorf("Expected Logs for invalid range return error, but got: %v", err) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// TestLogFilter tests whether log filters match the correct logs that are posted to the event feed.
|
|
|
|
|
func TestLogFilter(t *testing.T) { |
|
|
|
|
t.Parallel() |
|
|
|
|