1
1
use graph:: blockchain:: block_stream:: { EntitySourceOperation , FirehoseCursor } ;
2
+ use graph:: data:: store:: EntityV ;
2
3
use graph:: data:: subgraph:: schema:: DeploymentCreate ;
3
4
use graph:: data:: value:: Word ;
4
5
use graph:: data_source:: CausalityRegion ;
@@ -147,7 +148,7 @@ async fn insert_count(
147
148
let entity_op = if ( block != 3 && block != 5 && block != 7 ) || !immutable {
148
149
EntityOperation :: Set {
149
150
key : count_key_local ( & COUNTER_TYPE , & data. get ( "id" ) . unwrap ( ) . to_string ( ) ) ,
150
- data,
151
+ data : EntityV :: new ( data , block . into ( ) ) ,
151
152
}
152
153
} else {
153
154
EntityOperation :: Remove {
@@ -162,7 +163,7 @@ async fn insert_count(
162
163
} ;
163
164
let entity_op = EntityOperation :: Set {
164
165
key : count_key_local ( & COUNTER2_TYPE , & data. get ( "id" ) . unwrap ( ) . to_string ( ) ) ,
165
- data,
166
+ data : EntityV :: new ( data , block . into ( ) ) ,
166
167
} ;
167
168
ops. push ( entity_op) ;
168
169
}
@@ -340,10 +341,10 @@ fn read_range_test() {
340
341
r#"(1, [EntitySourceOperation { entity_op: Create, entity_type: EntityType(Counter), entity: Entity { count: Int(2), id: String("1") }, vid: 1 }, EntitySourceOperation { entity_op: Create, entity_type: EntityType(Counter2), entity: Entity { count: Int(2), id: String("1") }, vid: 1 }])"# ,
341
342
r#"(2, [EntitySourceOperation { entity_op: Modify, entity_type: EntityType(Counter), entity: Entity { count: Int(4), id: String("1") }, vid: 2 }, EntitySourceOperation { entity_op: Create, entity_type: EntityType(Counter2), entity: Entity { count: Int(4), id: String("2") }, vid: 2 }])"# ,
342
343
r#"(3, [EntitySourceOperation { entity_op: Delete, entity_type: EntityType(Counter), entity: Entity { count: Int(4), id: String("1") }, vid: 2 }, EntitySourceOperation { entity_op: Create, entity_type: EntityType(Counter2), entity: Entity { count: Int(6), id: String("3") }, vid: 3 }])"# ,
343
- r#"(4, [EntitySourceOperation { entity_op: Create, entity_type: EntityType(Counter), entity: Entity { count: Int(8), id: String("1") }, vid: 3 }, EntitySourceOperation { entity_op: Create, entity_type: EntityType(Counter2), entity: Entity { count: Int(8), id: String("4") }, vid: 4 }])"# ,
344
- r#"(5, [EntitySourceOperation { entity_op: Delete, entity_type: EntityType(Counter), entity: Entity { count: Int(8), id: String("1") }, vid: 3 }, EntitySourceOperation { entity_op: Create, entity_type: EntityType(Counter2), entity: Entity { count: Int(10), id: String("5") }, vid: 5 }])"# ,
345
- r#"(6, [EntitySourceOperation { entity_op: Create, entity_type: EntityType(Counter), entity: Entity { count: Int(12), id: String("1") }, vid: 4 }])"# ,
346
- r#"(7, [EntitySourceOperation { entity_op: Delete, entity_type: EntityType(Counter), entity: Entity { count: Int(12), id: String("1") }, vid: 4 }])"# ,
344
+ r#"(4, [EntitySourceOperation { entity_op: Create, entity_type: EntityType(Counter), entity: Entity { count: Int(8), id: String("1") }, vid: 4 }, EntitySourceOperation { entity_op: Create, entity_type: EntityType(Counter2), entity: Entity { count: Int(8), id: String("4") }, vid: 4 }])"# ,
345
+ r#"(5, [EntitySourceOperation { entity_op: Delete, entity_type: EntityType(Counter), entity: Entity { count: Int(8), id: String("1") }, vid: 4 }, EntitySourceOperation { entity_op: Create, entity_type: EntityType(Counter2), entity: Entity { count: Int(10), id: String("5") }, vid: 5 }])"# ,
346
+ r#"(6, [EntitySourceOperation { entity_op: Create, entity_type: EntityType(Counter), entity: Entity { count: Int(12), id: String("1") }, vid: 6 }])"# ,
347
+ r#"(7, [EntitySourceOperation { entity_op: Delete, entity_type: EntityType(Counter), entity: Entity { count: Int(12), id: String("1") }, vid: 6 }])"# ,
347
348
] ;
348
349
let subgraph_store = store. subgraph_store ( ) ;
349
350
writable. deployment_synced ( ) . unwrap ( ) ;
0 commit comments