@@ -121,6 +121,21 @@ impl TriggerFilter {
121
121
pub ( crate ) fn requires_traces ( & self ) -> bool {
122
122
!self . call . is_empty ( ) || self . block . requires_traces ( )
123
123
}
124
+
125
+ #[ cfg( debug_assertions) ]
126
+ pub fn log ( & self ) -> & EthereumLogFilter {
127
+ & self . log
128
+ }
129
+
130
+ #[ cfg( debug_assertions) ]
131
+ pub fn call ( & self ) -> & EthereumCallFilter {
132
+ & self . call
133
+ }
134
+
135
+ #[ cfg( debug_assertions) ]
136
+ pub fn block ( & self ) -> & EthereumBlockFilter {
137
+ & self . block
138
+ }
124
139
}
125
140
126
141
impl bc:: TriggerFilter < Chain > for TriggerFilter {
@@ -185,7 +200,7 @@ impl bc::TriggerFilter<Chain> for TriggerFilter {
185
200
}
186
201
187
202
#[ derive( Clone , Debug , Default ) ]
188
- pub ( crate ) struct EthereumLogFilter {
203
+ pub struct EthereumLogFilter {
189
204
/// Log filters can be represented as a bipartite graph between contracts and events. An edge
190
205
/// exists between a contract and an event if a data source for the contract has a trigger for
191
206
/// the event.
@@ -382,10 +397,20 @@ impl EthereumLogFilter {
382
397
}
383
398
filters. into_iter ( )
384
399
}
400
+
401
+ #[ cfg( debug_assertions) ]
402
+ pub fn contract_addresses ( & self ) -> impl Iterator < Item = Address > + ' _ {
403
+ self . contracts_and_events_graph
404
+ . nodes ( )
405
+ . filter_map ( |node| match node {
406
+ LogFilterNode :: Contract ( address) => Some ( address) ,
407
+ LogFilterNode :: Event ( _) => None ,
408
+ } )
409
+ }
385
410
}
386
411
387
412
#[ derive( Clone , Debug , Default ) ]
388
- pub ( crate ) struct EthereumCallFilter {
413
+ pub struct EthereumCallFilter {
389
414
// Each call filter has a map of filters keyed by address, each containing a tuple with
390
415
// start_block and the set of function signatures
391
416
pub contract_addresses_function_signatures :
@@ -583,7 +608,7 @@ impl From<&EthereumBlockFilter> for EthereumCallFilter {
583
608
}
584
609
585
610
#[ derive( Clone , Debug , Default ) ]
586
- pub ( crate ) struct EthereumBlockFilter {
611
+ pub struct EthereumBlockFilter {
587
612
/// Used for polling block handlers, a hashset of (start_block, polling_interval)
588
613
pub polling_intervals : HashSet < ( BlockNumber , i32 ) > ,
589
614
pub contract_addresses : HashSet < ( BlockNumber , Address ) > ,
0 commit comments