Skip to content

Commit bae437b

Browse files
author
Zoran Cvetkov
committed
fixes
1 parent ca47ec7 commit bae437b

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

graph/src/components/store/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use std::sync::atomic::{AtomicUsize, Ordering};
2525
use std::sync::{Arc, RwLock};
2626
use std::time::Duration;
2727

28-
use crate::blockchain::block_stream::EntityWithType;
2928
use crate::blockchain::{Block, BlockHash, BlockPtr};
3029
use crate::cheap_clone::CheapClone;
3130
use crate::components::store::write::EntityModification;

graph/src/components/store/traits.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,19 +300,21 @@ pub trait SourceableStore: DeploymentCursorTracker {
300300
/// changed in the given block_range.
301301
fn get_range(
302302
&self,
303-
entity_type: &EntityType,
303+
entity_types: Vec<EntityType>,
304+
causality_region: CausalityRegion,
304305
block_range: Range<BlockNumber>,
305-
) -> Result<BTreeMap<BlockNumber, Vec<Entity>>, StoreError>;
306+
) -> Result<BTreeMap<BlockNumber, Vec<EntityWithType>>, StoreError>;
306307
}
307308

308309
// This silly impl is needed until https://github.com/rust-lang/rust/issues/65991 is stable.
309310
impl<T: ?Sized + SourceableStore> SourceableStore for Arc<T> {
310311
fn get_range(
311312
&self,
312-
entity_type: &EntityType,
313+
entity_types: Vec<EntityType>,
314+
causality_region: CausalityRegion,
313315
block_range: Range<BlockNumber>,
314-
) -> Result<BTreeMap<BlockNumber, Vec<Entity>>, StoreError> {
315-
(**self).get_range(entity_type, block_range)
316+
) -> Result<BTreeMap<BlockNumber, Vec<EntityWithType>>, StoreError> {
317+
(**self).get_range(entity_types, causality_region, block_range)
316318
}
317319
}
318320

store/postgres/src/block_range.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ impl EntityBlockRange {
148148
let start: Bound<BlockNumber> = Bound::Included(block_range.start);
149149
let end: Bound<BlockNumber> = Bound::Excluded(block_range.end);
150150
let block_range: BlockRange = BlockRange(start, end);
151-
if table.immutable {
151+
if immutable {
152152
Self::Immutable(block_range)
153153
} else {
154154
Self::Mutable((block_range, is_uppper_range))

store/postgres/src/writable.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,11 +1592,16 @@ impl SourceableStore {
15921592
impl store::SourceableStore for SourceableStore {
15931593
fn get_range(
15941594
&self,
1595-
entity_type: &EntityType,
1595+
entity_types: Vec<EntityType>,
1596+
causality_region: CausalityRegion,
15961597
block_range: Range<BlockNumber>,
1597-
) -> Result<BTreeMap<BlockNumber, Vec<Entity>>, StoreError> {
1598-
self.store
1599-
.get_range(self.site.clone(), entity_type, block_range)
1598+
) -> Result<BTreeMap<BlockNumber, Vec<EntityWithType>>, StoreError> {
1599+
self.store.get_range(
1600+
self.site.clone(),
1601+
entity_types,
1602+
causality_region,
1603+
block_range,
1604+
)
16001605
}
16011606
}
16021607
impl DeploymentCursorTracker for SourceableStore {

store/test-store/tests/graph/entity_cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use graph::blockchain::block_stream::{EntityWithType, FirehoseCursor};
1+
use graph::blockchain::block_stream::FirehoseCursor;
22
use graph::blockchain::BlockTime;
33
use graph::components::store::{
44
DeploymentCursorTracker, DerivedEntityQuery, GetScope, LoadRelatedRequest, ReadStore,

0 commit comments

Comments
 (0)