Skip to content

Commit

Permalink
store: Assert that block_ptr_from < block_ptr_to
Browse files Browse the repository at this point in the history
  • Loading branch information
leoyvens committed Oct 28, 2019
1 parent 5a7d86e commit 16abb45
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions store/postgres/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,9 @@ impl StoreTrait for Store {
block_ptr_to: EthereumBlockPointer,
mods: Vec<EntityModification>,
) -> Result<bool, StoreError> {
// Improvement: Move this inside the transaction.
let block_ptr_from = self.block_ptr(subgraph_id.clone())?;
assert!(block_ptr_from.number < block_ptr_to.number);

// All operations should apply only to entities in this subgraph or
// the subgraph of subgraphs
Expand Down

0 comments on commit 16abb45

Please sign in to comment.