Skip to content

Commit eaf4b8c

Browse files
committed
graph: Update EthereumBlockFilter.extend() with block_type field
1 parent 18b49f8 commit eaf4b8c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

graph/src/components/ethereum/adapter.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,15 @@ impl EthereumBlockFilter {
478478

479479
pub fn extend(&mut self, other: EthereumBlockFilter) {
480480
self.trigger_every_block = self.trigger_every_block || other.trigger_every_block;
481+
self.block_type = match self.block_type {
482+
BlockType::FullWithReceipts => BlockType::FullWithReceipts,
483+
BlockType::Full => match other.block_type {
484+
BlockType::FullWithReceipts => BlockType::FullWithReceipts,
485+
_ => BlockType::Full,
486+
},
487+
BlockType::Light => other.block_type,
488+
};
489+
481490
self.contract_addresses = self.contract_addresses.iter().cloned().fold(
482491
HashSet::new(),
483492
|mut addresses, (start_block, address)| {
@@ -839,10 +848,10 @@ fn parse_block_triggers(
839848
.collect::<Vec<EthereumTrigger>>()
840849
});
841850
if trigger_every_block {
842-
triggers.push(EthereumTrigger::Block(
851+
triggers.push(dbg!(EthereumTrigger::Block(
843852
block_ptr,
844853
EthereumBlockTriggerType::Every(block_type),
845-
));
854+
)));
846855
}
847856
triggers
848857
}

0 commit comments

Comments
 (0)