@@ -203,9 +203,6 @@ impl PartialEq for EthereumTrigger {
203
203
204
204
impl Eq for EthereumTrigger { }
205
205
206
- /// This is used in `EthereumAdapter::triggers_in_block`, called when re-processing a block for
207
- /// newly created data sources. This allows the re-processing to be reorg safe without having to
208
- /// always fetch the full block data.
209
206
#[ derive( Clone , Debug ) ]
210
207
pub enum EthereumBlockType {
211
208
Light ( LightEthereumBlock ) ,
@@ -303,8 +300,8 @@ impl PartialOrd for EthereumTrigger {
303
300
304
301
pub struct EthereumTransactionReceiptData {
305
302
// from receipts
306
- pub transaction_hash : H256 ,
307
- pub transaction_index : Index ,
303
+ pub hash : H256 ,
304
+ pub index : Index ,
308
305
pub cumulative_gas_used : U256 ,
309
306
pub gas_used : Option < U256 > ,
310
307
pub contract_address : Option < H160 > ,
@@ -360,8 +357,8 @@ impl<'a> TryFrom<&'a EthereumBlockType> for FullEthereumBlockData {
360
357
transaction_and_receipt. 1 . transaction_hash
361
358
) ;
362
359
EthereumTransactionReceiptData {
363
- transaction_hash : transaction_and_receipt. 0 . hash ,
364
- transaction_index : transaction_and_receipt. 1 . transaction_index ,
360
+ hash : transaction_and_receipt. 0 . hash ,
361
+ index : transaction_and_receipt. 1 . transaction_index ,
365
362
cumulative_gas_used : transaction_and_receipt. 1 . cumulative_gas_used ,
366
363
gas_used : transaction_and_receipt. 1 . gas_used ,
367
364
contract_address : transaction_and_receipt. 1 . contract_address ,
@@ -413,8 +410,8 @@ impl<'a> From<&'a EthereumBlock> for FullEthereumBlockData {
413
410
transaction_and_receipt. 1 . transaction_hash
414
411
) ;
415
412
EthereumTransactionReceiptData {
416
- transaction_hash : transaction_and_receipt. 0 . hash ,
417
- transaction_index : transaction_and_receipt. 1 . transaction_index ,
413
+ hash : transaction_and_receipt. 0 . hash ,
414
+ index : transaction_and_receipt. 1 . transaction_index ,
418
415
cumulative_gas_used : transaction_and_receipt. 1 . cumulative_gas_used ,
419
416
gas_used : transaction_and_receipt. 1 . gas_used ,
420
417
contract_address : transaction_and_receipt. 1 . contract_address ,
@@ -470,10 +467,11 @@ pub struct EthereumBlockData {
470
467
pub difficulty : U256 ,
471
468
pub total_difficulty : U256 ,
472
469
pub size : Option < U256 > ,
470
+ pub transactions : Vec < EthereumTransactionData > ,
473
471
}
474
472
475
- impl < ' a , T > From < & ' a Block < T > > for EthereumBlockData {
476
- fn from ( block : & ' a Block < T > ) -> EthereumBlockData {
473
+ impl < ' a > From < & ' a LightEthereumBlock > for EthereumBlockData {
474
+ fn from ( block : & ' a LightEthereumBlock ) -> EthereumBlockData {
477
475
EthereumBlockData {
478
476
hash : block. hash . unwrap ( ) ,
479
477
parent_hash : block. parent_hash ,
@@ -489,6 +487,11 @@ impl<'a, T> From<&'a Block<T>> for EthereumBlockData {
489
487
difficulty : block. difficulty ,
490
488
total_difficulty : block. total_difficulty . unwrap_or_default ( ) ,
491
489
size : block. size ,
490
+ transactions : block
491
+ . transactions
492
+ . iter ( )
493
+ . map ( |tx| EthereumTransactionData :: from ( tx) )
494
+ . collect ( ) ,
492
495
}
493
496
}
494
497
}
@@ -515,6 +518,11 @@ impl<'a> From<&'a EthereumBlockType> for EthereumBlockData {
515
518
difficulty : block. difficulty ,
516
519
total_difficulty : block. total_difficulty . unwrap_or_default ( ) ,
517
520
size : block. size ,
521
+ transactions : block
522
+ . transactions
523
+ . iter ( )
524
+ . map ( |tx| EthereumTransactionData :: from ( tx) )
525
+ . collect ( ) ,
518
526
}
519
527
}
520
528
}
0 commit comments