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 {
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 {
@@ -166,7 +167,7 @@ async fn insert_count(
166
167
} ;
167
168
let entity_op = EntityOperation :: Set {
168
169
key : count_key_local ( & COUNTER2_TYPE , & data. get ( "id" ) . unwrap ( ) . to_string ( ) ) ,
169
- data,
170
+ data : EntityV :: new ( data , block . into ( ) ) ,
170
171
} ;
171
172
ops. push ( entity_op) ;
172
173
}
@@ -344,10 +345,10 @@ fn read_range_test() {
344
345
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 }])"# ,
345
346
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 }])"# ,
346
347
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 }])"# ,
347
- 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 }])"# ,
348
- 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 }])"# ,
349
- r#"(6, [EntitySourceOperation { entity_op: Create, entity_type: EntityType(Counter), entity: Entity { count: Int(12), id: String("1") }, vid: 4 }])"# ,
350
- r#"(7, [EntitySourceOperation { entity_op: Delete, entity_type: EntityType(Counter), entity: Entity { count: Int(12), id: String("1") }, vid: 4 }])"# ,
348
+ 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 }])"# ,
349
+ 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 }])"# ,
350
+ r#"(6, [EntitySourceOperation { entity_op: Create, entity_type: EntityType(Counter), entity: Entity { count: Int(12), id: String("1") }, vid: 6 }])"# ,
351
+ r#"(7, [EntitySourceOperation { entity_op: Delete, entity_type: EntityType(Counter), entity: Entity { count: Int(12), id: String("1") }, vid: 6 }])"# ,
351
352
] ;
352
353
let subgraph_store = store. subgraph_store ( ) ;
353
354
writable. deployment_synced ( ) . unwrap ( ) ;
0 commit comments