@@ -1490,7 +1490,7 @@ pub(crate) async fn blocks_with_triggers(
1490
1490
triggers_by_block. entry ( to) . or_insert ( Vec :: new ( ) ) ;
1491
1491
1492
1492
let mut blocks = adapter
1493
- . load_blocks ( logger1, chain_store, block_hashes)
1493
+ . load_blocks ( logger1, chain_store. clone ( ) , block_hashes)
1494
1494
. and_then (
1495
1495
move |block| match triggers_by_block. remove ( & ( block. number ( ) as BlockNumber ) ) {
1496
1496
Some ( triggers) => Ok ( BlockWithTriggers :: new (
@@ -1503,11 +1503,17 @@ pub(crate) async fn blocks_with_triggers(
1503
1503
) ) ,
1504
1504
} ,
1505
1505
)
1506
- // .map(|x| filter_call_triggers_from_unsuccessful_transactions(x))
1507
1506
. collect ( )
1508
1507
. compat ( )
1509
1508
. await ?;
1510
1509
1510
+ let section =
1511
+ stopwatch_metrics. start_section ( "filter_call_triggers_from_unsuccessful_transactions" ) ;
1512
+ for mut block in blocks. iter_mut ( ) {
1513
+ filter_call_triggers_from_unsuccessful_transactions ( & mut block, & eth, & chain_store) . await ?;
1514
+ }
1515
+ section. end ( ) ;
1516
+
1511
1517
blocks. sort_by_key ( |block| block. ptr ( ) . number ) ;
1512
1518
1513
1519
// Sanity check that the returned blocks are in the correct range.
@@ -1660,10 +1666,10 @@ async fn fetch_receipt_from_ethereum_client(
1660
1666
}
1661
1667
1662
1668
async fn filter_call_triggers_from_unsuccessful_transactions (
1663
- mut block : BlockWithTriggers < crate :: Chain > ,
1664
- chain_store : Arc < dyn ChainStore > ,
1665
- ) -> anyhow:: Result < BlockWithTriggers < crate :: Chain > > {
1669
+ block : & mut BlockWithTriggers < crate :: Chain > ,
1666
1670
eth : & EthereumAdapter ,
1671
+ chain_store : & Arc < dyn ChainStore > ,
1672
+ ) -> anyhow:: Result < ( ) > {
1667
1673
// First, we separate call triggers from other trigger types
1668
1674
let calls: Vec < & Arc < EthereumCall > > = block
1669
1675
. trigger_data
@@ -1685,7 +1691,7 @@ async fn filter_call_triggers_from_unsuccessful_transactions(
1685
1691
1686
1692
// And obtain all Transaction values for the calls in this block.
1687
1693
let transactions: Vec < & Transaction > = {
1688
- match block. block {
1694
+ match & block. block {
1689
1695
BlockFinality :: Final ( _block) => {
1690
1696
unreachable ! ( "this function should not be called for dealing with final blocks" )
1691
1697
}
@@ -1758,7 +1764,7 @@ async fn filter_call_triggers_from_unsuccessful_transactions(
1758
1764
true
1759
1765
}
1760
1766
} ) ;
1761
- Ok ( block )
1767
+ Ok ( ( ) )
1762
1768
}
1763
1769
1764
1770
fn is_transaction_successful (
0 commit comments