@@ -209,12 +209,14 @@ fn insert_modifications() {
209209
210210 let mogwai_data = entity ! { SCHEMA => id: "mogwai" , name: "Mogwai" } ;
211211 let mogwai_key = make_band_key ( "mogwai" ) ;
212- cache. set ( mogwai_key. clone ( ) , mogwai_data. clone ( ) ) . unwrap ( ) ;
212+ cache
213+ . set ( mogwai_key. clone ( ) , mogwai_data. clone ( ) , None )
214+ . unwrap ( ) ;
213215
214216 let sigurros_data = entity ! { SCHEMA => id: "sigurros" , name: "Sigur Ros" } ;
215217 let sigurros_key = make_band_key ( "sigurros" ) ;
216218 cache
217- . set ( sigurros_key. clone ( ) , sigurros_data. clone ( ) )
219+ . set ( sigurros_key. clone ( ) , sigurros_data. clone ( ) , None )
218220 . unwrap ( ) ;
219221
220222 let result = cache. as_modifications ( 0 ) ;
@@ -253,12 +255,14 @@ fn overwrite_modifications() {
253255
254256 let mogwai_data = entity ! { SCHEMA => id: "mogwai" , name: "Mogwai" , founded: 1995 } ;
255257 let mogwai_key = make_band_key ( "mogwai" ) ;
256- cache. set ( mogwai_key. clone ( ) , mogwai_data. clone ( ) ) . unwrap ( ) ;
258+ cache
259+ . set ( mogwai_key. clone ( ) , mogwai_data. clone ( ) , None )
260+ . unwrap ( ) ;
257261
258262 let sigurros_data = entity ! { SCHEMA => id: "sigurros" , name: "Sigur Ros" , founded: 1994 } ;
259263 let sigurros_key = make_band_key ( "sigurros" ) ;
260264 cache
261- . set ( sigurros_key. clone ( ) , sigurros_data. clone ( ) )
265+ . set ( sigurros_key. clone ( ) , sigurros_data. clone ( ) , None )
262266 . unwrap ( ) ;
263267
264268 let result = cache. as_modifications ( 0 ) ;
@@ -289,12 +293,12 @@ fn consecutive_modifications() {
289293 let update_data =
290294 entity ! { SCHEMA => id: "mogwai" , founded: 1995 , label: "Rock Action Records" } ;
291295 let update_key = make_band_key ( "mogwai" ) ;
292- cache. set ( update_key, update_data) . unwrap ( ) ;
296+ cache. set ( update_key, update_data, None ) . unwrap ( ) ;
293297
294298 // Then, just reset the "label".
295299 let update_data = entity ! { SCHEMA => id: "mogwai" , label: Value :: Null } ;
296300 let update_key = make_band_key ( "mogwai" ) ;
297- cache. set ( update_key. clone ( ) , update_data) . unwrap ( ) ;
301+ cache. set ( update_key. clone ( ) , update_data, None ) . unwrap ( ) ;
298302
299303 // We expect a single overwrite modification for the above that leaves "id"
300304 // and "name" untouched, sets "founded" and removes the "label" field.
@@ -715,7 +719,7 @@ fn scoped_get() {
715719 let account5 = ACCOUNT_TYPE . parse_id ( "5" ) . unwrap ( ) ;
716720 let wallet5 = create_wallet_entity ( "5" , & account5, 100 ) ;
717721 let key5 = WALLET_TYPE . parse_key ( "5" ) . unwrap ( ) ;
718- cache. set ( key5. clone ( ) , wallet5. clone ( ) ) . unwrap ( ) ;
722+ cache. set ( key5. clone ( ) , wallet5. clone ( ) , None ) . unwrap ( ) ;
719723
720724 // For the new entity, we can retrieve it with either scope
721725 let act5 = cache. get ( & key5, GetScope :: InBlock ) . unwrap ( ) ;
@@ -736,7 +740,7 @@ fn scoped_get() {
736740 // But if it gets updated, it becomes visible with either scope
737741 let mut wallet1 = wallet1;
738742 wallet1. set ( "balance" , 70 ) . unwrap ( ) ;
739- cache. set ( key1. clone ( ) , wallet1. clone ( ) ) . unwrap ( ) ;
743+ cache. set ( key1. clone ( ) , wallet1. clone ( ) , None ) . unwrap ( ) ;
740744 let act1 = cache. get ( & key1, GetScope :: InBlock ) . unwrap ( ) ;
741745 assert_eq ! ( Some ( & wallet1) , act1. as_ref( ) . map( |e| e. as_ref( ) ) ) ;
742746 let act1 = cache. get ( & key1, GetScope :: Store ) . unwrap ( ) ;
@@ -783,6 +787,6 @@ fn no_interface_mods() {
783787
784788 let entity = entity ! { LOAD_RELATED_SUBGRAPH => id: "1" , balance: 100 } ;
785789
786- cache. set ( key, entity) . unwrap_err ( ) ;
790+ cache. set ( key, entity, None ) . unwrap_err ( ) ;
787791 } )
788792}
0 commit comments