@@ -210,21 +210,21 @@ fn insert_modifications() {
210210 let mogwai_data = entity ! { SCHEMA => id: "mogwai" , name: "Mogwai" } ;
211211 let mogwai_key = make_band_key ( "mogwai" ) ;
212212 cache
213- . set ( mogwai_key. clone ( ) , EntityV :: new ( mogwai_data. clone ( ) , 0 ) )
213+ . set ( mogwai_key. clone ( ) , mogwai_data. clone ( ) , 0 )
214214 . unwrap ( ) ;
215215
216216 let sigurros_data = entity ! { SCHEMA => id: "sigurros" , name: "Sigur Ros" } ;
217217 let sigurros_key = make_band_key ( "sigurros" ) ;
218218 cache
219- . set ( sigurros_key. clone ( ) , EntityV :: new ( sigurros_data. clone ( ) , 0 ) )
219+ . set ( sigurros_key. clone ( ) , sigurros_data. clone ( ) , 0 )
220220 . unwrap ( ) ;
221221
222222 let result = cache. as_modifications ( 0 ) ;
223223 assert_eq ! (
224224 sort_by_entity_key( result. unwrap( ) . modifications) ,
225225 sort_by_entity_key( vec![
226226 EntityModification :: insert( mogwai_key, mogwai_data, 0 , 0 ) ,
227- EntityModification :: insert( sigurros_key, sigurros_data, 0 , 0 )
227+ EntityModification :: insert( sigurros_key, sigurros_data, 0 , 1 )
228228 ] )
229229 ) ;
230230}
@@ -256,21 +256,21 @@ fn overwrite_modifications() {
256256 let mogwai_data = entity ! { SCHEMA => id: "mogwai" , name: "Mogwai" , founded: 1995 } ;
257257 let mogwai_key = make_band_key ( "mogwai" ) ;
258258 cache
259- . set ( mogwai_key. clone ( ) , EntityV :: new ( mogwai_data. clone ( ) , 0 ) )
259+ . set ( mogwai_key. clone ( ) , mogwai_data. clone ( ) , 0 )
260260 . unwrap ( ) ;
261261
262262 let sigurros_data = entity ! { SCHEMA => id: "sigurros" , name: "Sigur Ros" , founded: 1994 } ;
263263 let sigurros_key = make_band_key ( "sigurros" ) ;
264264 cache
265- . set ( sigurros_key. clone ( ) , EntityV :: new ( sigurros_data. clone ( ) , 0 ) )
265+ . set ( sigurros_key. clone ( ) , sigurros_data. clone ( ) , 0 )
266266 . unwrap ( ) ;
267267
268268 let result = cache. as_modifications ( 0 ) ;
269269 assert_eq ! (
270270 sort_by_entity_key( result. unwrap( ) . modifications) ,
271271 sort_by_entity_key( vec![
272272 EntityModification :: overwrite( mogwai_key, mogwai_data, 0 , 0 ) ,
273- EntityModification :: overwrite( sigurros_key, sigurros_data, 0 , 0 )
273+ EntityModification :: overwrite( sigurros_key, sigurros_data, 0 , 1 )
274274 ] )
275275 ) ;
276276}
@@ -293,14 +293,12 @@ fn consecutive_modifications() {
293293 let update_data =
294294 entity ! { SCHEMA => id: "mogwai" , founded: 1995 , label: "Rock Action Records" } ;
295295 let update_key = make_band_key ( "mogwai" ) ;
296- cache. set ( update_key, EntityV :: new ( update_data, 0 ) ) . unwrap ( ) ;
296+ cache. set ( update_key, update_data, 0 ) . unwrap ( ) ;
297297
298298 // Then, just reset the "label".
299299 let update_data = entity ! { SCHEMA => id: "mogwai" , label: Value :: Null } ;
300300 let update_key = make_band_key ( "mogwai" ) ;
301- cache
302- . set ( update_key. clone ( ) , EntityV :: new ( update_data, 0 ) )
303- . unwrap ( ) ;
301+ cache. set ( update_key. clone ( ) , update_data, 0 ) . unwrap ( ) ;
304302
305303 // We expect a single overwrite modification for the above that leaves "id"
306304 // and "name" untouched, sets "founded" and removes the "label" field.
@@ -721,9 +719,7 @@ fn scoped_get() {
721719 let account5 = ACCOUNT_TYPE . parse_id ( "5" ) . unwrap ( ) ;
722720 let wallet5 = create_wallet_entity ( "5" , & account5, 100 ) ;
723721 let key5 = WALLET_TYPE . parse_key ( "5" ) . unwrap ( ) ;
724- cache
725- . set ( key5. clone ( ) , EntityV :: new ( wallet5. clone ( ) , 5 ) )
726- . unwrap ( ) ;
722+ cache. set ( key5. clone ( ) , wallet5. clone ( ) , 0 ) . unwrap ( ) ;
727723
728724 // For the new entity, we can retrieve it with either scope
729725 let act5 = cache. get ( & key5, GetScope :: InBlock ) . unwrap ( ) ;
@@ -744,9 +740,7 @@ fn scoped_get() {
744740 // But if it gets updated, it becomes visible with either scope
745741 let mut wallet1 = wallet1;
746742 wallet1. set ( "balance" , 70 ) . unwrap ( ) ;
747- cache
748- . set ( key1. clone ( ) , EntityV :: new ( wallet1. clone ( ) , 1 ) )
749- . unwrap ( ) ;
743+ cache. set ( key1. clone ( ) , wallet1. clone ( ) , 0 ) . unwrap ( ) ;
750744 let act1 = cache. get ( & key1, GetScope :: InBlock ) . unwrap ( ) ;
751745 assert_eq ! ( Some ( & wallet1) , act1. as_ref( ) . map( |e| e. as_ref( ) ) ) ;
752746 let act1 = cache. get ( & key1, GetScope :: Store ) . unwrap ( ) ;
@@ -793,6 +787,6 @@ fn no_interface_mods() {
793787
794788 let entity = entity ! { LOAD_RELATED_SUBGRAPH => id: "1" , balance: 100 } ;
795789
796- cache. set ( key, EntityV :: new ( entity, 0 ) ) . unwrap_err ( ) ;
790+ cache. set ( key, entity, 0 ) . unwrap_err ( ) ;
797791 } )
798792}
0 commit comments