diff --git a/store/postgres/src/writable.rs b/store/postgres/src/writable.rs index f6467d5fb1d..d539b4e4bc6 100644 --- a/store/postgres/src/writable.rs +++ b/store/postgres/src/writable.rs @@ -218,26 +218,26 @@ impl WritableStore { fn transact_block_operations( &self, - block_ptr_to: BlockPtr, - firehose_cursor: Option, - mods: Vec, + block_ptr_to: &BlockPtr, + firehose_cursor: Option<&str>, + mods: &[EntityModification], stopwatch: StopwatchMetrics, - data_sources: Vec, - deterministic_errors: Vec, + data_sources: &[StoredDynamicDataSource], + deterministic_errors: &[SubgraphError], ) -> Result<(), StoreError> { assert!( - same_subgraph(&mods, &self.site.deployment), + same_subgraph(mods, &self.site.deployment), "can only transact operations within one shard" ); self.retry("transact_block_operations", move || { let event = self.writable.transact_block_operations( self.site.clone(), - &block_ptr_to, - firehose_cursor.as_deref(), - &mods, + block_ptr_to, + firehose_cursor, + mods, stopwatch.cheap_clone(), - &data_sources, - &deterministic_errors, + data_sources, + deterministic_errors, )?; let _section = stopwatch.start_section("send_store_event"); @@ -319,7 +319,7 @@ impl WritableStore { } } -fn same_subgraph(mods: &Vec, id: &DeploymentHash) -> bool { +fn same_subgraph(mods: &[EntityModification], id: &DeploymentHash) -> bool { mods.iter().all(|md| &md.entity_key().subgraph_id == id) } @@ -407,12 +407,12 @@ impl WritableStoreTrait for WritableAgent { deterministic_errors: Vec, ) -> Result<(), StoreError> { self.store.transact_block_operations( - block_ptr_to.clone(), - firehose_cursor.clone(), - mods, + &block_ptr_to, + firehose_cursor.as_deref(), + &mods, stopwatch, - data_sources, - deterministic_errors, + &data_sources, + &deterministic_errors, )?; *self.block_ptr.lock().unwrap() = Some(block_ptr_to);