@@ -21,10 +21,10 @@ use graph::futures03::{
21
21
self , compat:: Future01CompatExt , FutureExt , StreamExt , TryFutureExt , TryStreamExt ,
22
22
} ;
23
23
use graph:: prelude:: alloy:: primitives:: Address ;
24
- use graph:: prelude:: alloy:: rpc:: types:: Transaction ;
25
24
use graph:: prelude:: {
26
25
alloy:: {
27
26
self ,
27
+ network:: TransactionResponse ,
28
28
primitives:: B256 ,
29
29
providers:: {
30
30
ext:: TraceApi ,
@@ -732,7 +732,7 @@ impl EthereumAdapter {
732
732
. map_err ( Error :: from)
733
733
. and_then ( |block| {
734
734
block
735
- . map ( |b| Arc :: new ( LightEthereumBlock :: new ( b) ) )
735
+ . map ( |b| Arc :: new ( LightEthereumBlock :: new ( b. into ( ) ) ) )
736
736
. ok_or_else ( || {
737
737
anyhow:: anyhow!(
738
738
"Ethereum node did not find block {:?}" ,
@@ -1334,7 +1334,7 @@ impl EthereumAdapterTrait for EthereumAdapter {
1334
1334
if block. transactions . is_empty ( ) {
1335
1335
trace ! ( logger, "Block {} contains no transactions" , block_hash) ;
1336
1336
return Ok ( EthereumBlock {
1337
- block : Arc :: new ( LightEthereumBlock :: new ( block) ) ,
1337
+ block : Arc :: new ( LightEthereumBlock :: new ( block. into ( ) ) ) ,
1338
1338
transaction_receipts : Vec :: new ( ) ,
1339
1339
} ) ;
1340
1340
}
@@ -1353,7 +1353,7 @@ impl EthereumAdapterTrait for EthereumAdapter {
1353
1353
fetch_receipts_with_retry ( alloy, hashes, block_hash, logger, supports_block_receipts)
1354
1354
. await
1355
1355
. map ( |transaction_receipts| EthereumBlock {
1356
- block : Arc :: new ( LightEthereumBlock :: new ( block) ) ,
1356
+ block : Arc :: new ( LightEthereumBlock :: new ( block. into ( ) ) ) ,
1357
1357
transaction_receipts : transaction_receipts
1358
1358
. into_iter ( )
1359
1359
. map ( |receipt| receipt)
@@ -2043,13 +2043,13 @@ async fn filter_call_triggers_from_unsuccessful_transactions(
2043
2043
}
2044
2044
2045
2045
// And obtain all Transaction values for the calls in this block.
2046
- let transactions: Vec < & Transaction > = {
2046
+ let transactions: Vec < & AnyTransaction > = {
2047
2047
match & block. block {
2048
2048
BlockFinality :: Final ( ref block) => block
2049
2049
. transactions ( )
2050
2050
. ok_or_else ( || anyhow ! ( "Block transactions not available" ) ) ?
2051
2051
. iter ( )
2052
- . filter ( |transaction| transaction_hashes. contains ( transaction. inner . tx_hash ( ) ) )
2052
+ . filter ( |transaction| transaction_hashes. contains ( & transaction. tx_hash ( ) ) )
2053
2053
. collect ( ) ,
2054
2054
BlockFinality :: NonFinal ( _block_with_calls) => {
2055
2055
unreachable ! (
@@ -2079,21 +2079,21 @@ async fn filter_call_triggers_from_unsuccessful_transactions(
2079
2079
. collect :: < BTreeMap < B256 , LightTransactionReceipt > > ( ) ;
2080
2080
2081
2081
// 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 ( ) ;
2084
2084
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) ) ;
2087
2087
} else {
2088
- transactions_without_receipt. push ( transaction) ;
2088
+ transactions_without_receipt. push ( * transaction) ;
2089
2089
}
2090
2090
}
2091
2091
2092
2092
// When some receipts are missing, we then try to fetch them from our client.
2093
2093
let futures = transactions_without_receipt
2094
2094
. iter ( )
2095
2095
. 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 ( ) )
2097
2097
. await
2098
2098
. map ( |receipt| ( transaction, receipt) )
2099
2099
} ) ;
@@ -2108,9 +2108,9 @@ async fn filter_call_triggers_from_unsuccessful_transactions(
2108
2108
// additional Ethereum API calls for future scans on this block.
2109
2109
2110
2110
// 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 ( ) ;
2112
2112
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 ) ;
2114
2114
}
2115
2115
2116
2116
// Confidence check: Did we inspect the status of all transactions?
@@ -2623,7 +2623,7 @@ mod tests {
2623
2623
2624
2624
let block = EthereumBlockWithCalls {
2625
2625
ethereum_block : EthereumBlock {
2626
- block : Arc :: new ( LightEthereumBlock :: new ( block) ) ,
2626
+ block : Arc :: new ( LightEthereumBlock :: new ( block. into ( ) ) ) ,
2627
2627
..Default :: default ( )
2628
2628
} ,
2629
2629
calls : Some ( vec ! [ EthereumCall {
@@ -2765,7 +2765,7 @@ mod tests {
2765
2765
#[ allow( unreachable_code) ]
2766
2766
let block = EthereumBlockWithCalls {
2767
2767
ethereum_block : EthereumBlock {
2768
- block : Arc :: new ( LightEthereumBlock :: new ( block) ) ,
2768
+ block : Arc :: new ( LightEthereumBlock :: new ( block. into ( ) ) ) ,
2769
2769
..Default :: default ( )
2770
2770
} ,
2771
2771
calls : Some ( vec ! [ EthereumCall {
@@ -2796,7 +2796,7 @@ mod tests {
2796
2796
#[ allow( unreachable_code) ]
2797
2797
let block = EthereumBlockWithCalls {
2798
2798
ethereum_block : EthereumBlock {
2799
- block : Arc :: new ( LightEthereumBlock :: new ( block) ) ,
2799
+ block : Arc :: new ( LightEthereumBlock :: new ( block. into ( ) ) ) ,
2800
2800
..Default :: default ( )
2801
2801
} ,
2802
2802
calls : Some ( vec ! [ EthereumCall {
0 commit comments