Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -2170,11 +2170,15 @@ func RegisterFilterAPI(stack *node.Node, backend ethapi.Backend, ethcfg *ethconf
LogCacheSize: ethcfg.FilterLogCacheSize,
})

filterAPI := filters.NewFilterAPI(filterSystem, isLightClient, ethconfig.Defaults.BorLogs)
stack.RegisterAPIs([]rpc.API{{
Namespace: "eth",
Service: filters.NewFilterAPI(filterSystem, isLightClient, ethconfig.Defaults.BorLogs),
Service: filterAPI,
}})

// avoiding constructor changed by introducing new method to set genesis
filterAPI.SetChainConfig(ethcfg.Genesis.Config)

return filterSystem
}

Expand Down
3 changes: 3 additions & 0 deletions eth/filters/filter_system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,8 @@ func TestInvalidGetLogsRequest(t *testing.T) {
blockHash = common.HexToHash("0x1111111111111111111111111111111111111111111111111111111111111111")
)

api.SetChainConfig(params.BorUnittestChainConfig)

// Reason: Cannot specify both BlockHash and FromBlock/ToBlock)
testCases := []FilterCriteria{
0: {BlockHash: &blockHash, FromBlock: big.NewInt(100)},
Expand Down Expand Up @@ -808,6 +810,7 @@ func TestPendingLogsSubscription(t *testing.T) {
<-testCases[i].sub.Err()
}
}

// nolint:gocognit
func TestLightFilterLogs(t *testing.T) {
t.Parallel()
Expand Down