@@ -285,13 +285,13 @@ impl RuntimeHost {
285
285
286
286
fn matches_block_trigger ( & self , block_trigger_type : & EthereumBlockTriggerType ) -> bool {
287
287
let source_address_matches = match block_trigger_type {
288
- EthereumBlockTriggerType :: WithCallTo ( address, _block_type ) => {
288
+ EthereumBlockTriggerType :: WithCallTo ( address) => {
289
289
self . data_source_contract
290
290
. address
291
291
// Do not match if this datasource has no address
292
292
. map_or ( false , |addr| addr == * address)
293
293
}
294
- EthereumBlockTriggerType :: Every ( _ ) => true ,
294
+ EthereumBlockTriggerType :: Every => true ,
295
295
} ;
296
296
source_address_matches && self . handler_for_block ( block_trigger_type) . is_ok ( )
297
297
}
@@ -347,7 +347,7 @@ impl RuntimeHost {
347
347
trigger_type : & EthereumBlockTriggerType ,
348
348
) -> Result < MappingBlockHandler , anyhow:: Error > {
349
349
match trigger_type {
350
- EthereumBlockTriggerType :: Every ( _block_type ) => self
350
+ EthereumBlockTriggerType :: Every => self
351
351
. data_source_block_handlers
352
352
. iter ( )
353
353
. find ( move |handler| handler. filter == None )
@@ -359,7 +359,7 @@ impl RuntimeHost {
359
359
self . data_source_name,
360
360
)
361
361
} ) ,
362
- EthereumBlockTriggerType :: WithCallTo ( _address, _block_type ) => self
362
+ EthereumBlockTriggerType :: WithCallTo ( _address) => self
363
363
. data_source_block_handlers
364
364
. iter ( )
365
365
. find ( move |handler| {
@@ -571,13 +571,13 @@ impl RuntimeHostTrait for RuntimeHost {
571
571
& self ,
572
572
logger : & Logger ,
573
573
block : & Arc < EthereumBlockType > ,
574
- trigger_type : & EthereumBlockTriggerType ,
574
+ trigger : & EthereumBlockTrigger ,
575
575
state : BlockState ,
576
576
proof_of_indexing : SharedProofOfIndexing ,
577
577
) -> Result < BlockState , anyhow:: Error > {
578
- let block_handler = self . handler_for_block ( trigger_type) ?;
579
- let mapping_block: EthereumBlockType = match trigger_type {
580
- EthereumBlockTriggerType :: Every ( BlockType :: FullWithReceipts ) => match self
578
+ let block_handler = self . handler_for_block ( & trigger . trigger_type ) ?;
579
+ let mapping_block: EthereumBlockType = match trigger . block_type {
580
+ BlockType :: FullWithReceipts => match self
581
581
. host_exports
582
582
. ethereum_adapter
583
583
. load_full_block ( logger, block. light_block ( ) . clone ( ) )
@@ -591,10 +591,8 @@ impl RuntimeHostTrait for RuntimeHost {
591
591
e
592
592
) ) ,
593
593
} ?,
594
- EthereumBlockTriggerType :: Every ( BlockType :: Full ) => {
595
- EthereumBlockType :: Full ( block. light_block ( ) . clone ( ) )
596
- }
597
- _ => block. as_ref ( ) . clone ( ) ,
594
+ BlockType :: Full => EthereumBlockType :: Full ( block. light_block ( ) . clone ( ) ) ,
595
+ BlockType :: Light => block. as_ref ( ) . clone ( ) ,
598
596
} ;
599
597
600
598
self . send_mapping_request (
0 commit comments