mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix(rpc): less clones in logs filter (#7060)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@ -5,7 +5,6 @@ use reth_provider::{
|
||||
StateProvider, TransactionsProvider,
|
||||
};
|
||||
use reth_rpc_types::{Filter, FilteredParams};
|
||||
use reth_rpc_types_compat::log::from_primitive_log;
|
||||
use std::path::Path;
|
||||
|
||||
// Providers are zero cost abstractions on top of an opened MDBX Transaction
|
||||
@ -201,8 +200,9 @@ fn receipts_provider_example<T: ReceiptProvider + TransactionsProvider + HeaderP
|
||||
{
|
||||
let receipts = provider.receipt(header_num)?.ok_or(eyre::eyre!("receipt not found"))?;
|
||||
for log in &receipts.logs {
|
||||
let log = from_primitive_log(log.clone());
|
||||
if filter_params.filter_address(&log) && filter_params.filter_topics(&log) {
|
||||
if filter_params.filter_address(&log.address) &&
|
||||
filter_params.filter_topics(&log.topics)
|
||||
{
|
||||
// Do something with the log e.g. decode it.
|
||||
println!("Matching log found! {log:?}")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user