refactor(rpc): simplify the inner definitions of topics & address filters (#3876)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Nicolas Gotchac
2023-07-28 13:00:37 +02:00
committed by GitHub
parent d2cdd10ed2
commit 0892833842
7 changed files with 276 additions and 381 deletions

View File

@ -186,8 +186,8 @@ fn receipts_provider_example<T: ReceiptProvider + TransactionsProvider + HeaderP
// topics. This API is a bit clunky and not obvious to use at the moemnt.
let filter = Filter::new().address(addr).topic0(topic);
let filter_params = FilteredParams::new(Some(filter));
let address_filter = FilteredParams::address_filter(&Some(addr.into()));
let topics_filter = FilteredParams::topics_filter(&Some(vec![topic.into()]));
let address_filter = FilteredParams::address_filter(&addr.into());
let topics_filter = FilteredParams::topics_filter(&[topic.into()]);
// 3. If the address & topics filters match do something. We use the outer check against the
// bloom filter stored in the header to avoid having to query the receipts table when there