@@ -21,10 +21,10 @@ use graph::futures03::{
2121 self , compat:: Future01CompatExt , FutureExt , StreamExt , TryFutureExt , TryStreamExt ,
2222} ;
2323use graph:: prelude:: alloy:: primitives:: Address ;
24- use graph:: prelude:: alloy:: rpc:: types:: Transaction ;
2524use graph:: prelude:: {
2625 alloy:: {
2726 self ,
27+ network:: TransactionResponse ,
2828 primitives:: B256 ,
2929 providers:: {
3030 ext:: TraceApi ,
@@ -732,7 +732,7 @@ impl EthereumAdapter {
732732 . map_err ( Error :: from)
733733 . and_then ( |block| {
734734 block
735- . map ( |b| Arc :: new ( LightEthereumBlock :: new ( b) ) )
735+ . map ( |b| Arc :: new ( LightEthereumBlock :: new ( b. into ( ) ) ) )
736736 . ok_or_else ( || {
737737 anyhow:: anyhow!(
738738 "Ethereum node did not find block {:?}" ,
@@ -1334,7 +1334,7 @@ impl EthereumAdapterTrait for EthereumAdapter {
13341334 if block. transactions . is_empty ( ) {
13351335 trace ! ( logger, "Block {} contains no transactions" , block_hash) ;
13361336 return Ok ( EthereumBlock {
1337- block : Arc :: new ( LightEthereumBlock :: new ( block) ) ,
1337+ block : Arc :: new ( LightEthereumBlock :: new ( block. into ( ) ) ) ,
13381338 transaction_receipts : Vec :: new ( ) ,
13391339 } ) ;
13401340 }
@@ -1353,7 +1353,7 @@ impl EthereumAdapterTrait for EthereumAdapter {
13531353 fetch_receipts_with_retry ( alloy, hashes, block_hash, logger, supports_block_receipts)
13541354 . await
13551355 . map ( |transaction_receipts| EthereumBlock {
1356- block : Arc :: new ( LightEthereumBlock :: new ( block) ) ,
1356+ block : Arc :: new ( LightEthereumBlock :: new ( block. into ( ) ) ) ,
13571357 transaction_receipts : transaction_receipts
13581358 . into_iter ( )
13591359 . map ( |receipt| receipt)
@@ -2043,13 +2043,13 @@ async fn filter_call_triggers_from_unsuccessful_transactions(
20432043 }
20442044
20452045 // And obtain all Transaction values for the calls in this block.
2046- let transactions: Vec < & Transaction > = {
2046+ let transactions: Vec < & AnyTransaction > = {
20472047 match & block. block {
20482048 BlockFinality :: Final ( ref block) => block
20492049 . transactions ( )
20502050 . ok_or_else ( || anyhow ! ( "Block transactions not available" ) ) ?
20512051 . iter ( )
2052- . filter ( |transaction| transaction_hashes. contains ( transaction. inner . tx_hash ( ) ) )
2052+ . filter ( |transaction| transaction_hashes. contains ( & transaction. tx_hash ( ) ) )
20532053 . collect ( ) ,
20542054 BlockFinality :: NonFinal ( _block_with_calls) => {
20552055 unreachable ! (
@@ -2079,21 +2079,21 @@ async fn filter_call_triggers_from_unsuccessful_transactions(
20792079 . collect :: < BTreeMap < B256 , LightTransactionReceipt > > ( ) ;
20802080
20812081 // Do we have a receipt for each transaction under analysis?
2082- let mut receipts_and_transactions: Vec < ( & Transaction , LightTransactionReceipt ) > = Vec :: new ( ) ;
2083- let mut transactions_without_receipt: Vec < & Transaction > = Vec :: new ( ) ;
2082+ let mut receipts_and_transactions: Vec < ( & AnyTransaction , LightTransactionReceipt ) > = Vec :: new ( ) ;
2083+ let mut transactions_without_receipt: Vec < & AnyTransaction > = Vec :: new ( ) ;
20842084 for transaction in transactions. iter ( ) {
2085- if let Some ( receipt) = receipts. remove ( transaction. inner . tx_hash ( ) ) {
2086- receipts_and_transactions. push ( ( transaction, receipt) ) ;
2085+ if let Some ( receipt) = receipts. remove ( & transaction. tx_hash ( ) ) {
2086+ receipts_and_transactions. push ( ( * transaction, receipt) ) ;
20872087 } else {
2088- transactions_without_receipt. push ( transaction) ;
2088+ transactions_without_receipt. push ( * transaction) ;
20892089 }
20902090 }
20912091
20922092 // When some receipts are missing, we then try to fetch them from our client.
20932093 let futures = transactions_without_receipt
20942094 . iter ( )
20952095 . map ( |transaction| async move {
2096- fetch_receipt_from_ethereum_client ( eth, * transaction. inner . tx_hash ( ) )
2096+ fetch_receipt_from_ethereum_client ( eth, transaction. tx_hash ( ) )
20972097 . await
20982098 . map ( |receipt| ( transaction, receipt) )
20992099 } ) ;
@@ -2108,9 +2108,9 @@ async fn filter_call_triggers_from_unsuccessful_transactions(
21082108 // additional Ethereum API calls for future scans on this block.
21092109
21102110 // With all transactions and receipts in hand, we can evaluate the success of each transaction
2111- let mut transaction_success: BTreeMap < & B256 , bool > = BTreeMap :: new ( ) ;
2111+ let mut transaction_success: BTreeMap < B256 , bool > = BTreeMap :: new ( ) ;
21122112 for ( transaction, receipt) in receipts_and_transactions. into_iter ( ) {
2113- transaction_success. insert ( & transaction. inner . tx_hash ( ) , receipt. status ) ;
2113+ transaction_success. insert ( transaction. tx_hash ( ) , receipt. status ) ;
21142114 }
21152115
21162116 // Confidence check: Did we inspect the status of all transactions?
@@ -2623,7 +2623,7 @@ mod tests {
26232623
26242624 let block = EthereumBlockWithCalls {
26252625 ethereum_block : EthereumBlock {
2626- block : Arc :: new ( LightEthereumBlock :: new ( block) ) ,
2626+ block : Arc :: new ( LightEthereumBlock :: new ( block. into ( ) ) ) ,
26272627 ..Default :: default ( )
26282628 } ,
26292629 calls : Some ( vec ! [ EthereumCall {
@@ -2765,7 +2765,7 @@ mod tests {
27652765 #[ allow( unreachable_code) ]
27662766 let block = EthereumBlockWithCalls {
27672767 ethereum_block : EthereumBlock {
2768- block : Arc :: new ( LightEthereumBlock :: new ( block) ) ,
2768+ block : Arc :: new ( LightEthereumBlock :: new ( block. into ( ) ) ) ,
27692769 ..Default :: default ( )
27702770 } ,
27712771 calls : Some ( vec ! [ EthereumCall {
@@ -2796,7 +2796,7 @@ mod tests {
27962796 #[ allow( unreachable_code) ]
27972797 let block = EthereumBlockWithCalls {
27982798 ethereum_block : EthereumBlock {
2799- block : Arc :: new ( LightEthereumBlock :: new ( block) ) ,
2799+ block : Arc :: new ( LightEthereumBlock :: new ( block. into ( ) ) ) ,
28002800 ..Default :: default ( )
28012801 } ,
28022802 calls : Some ( vec ! [ EthereumCall {
0 commit comments