@@ -11,13 +11,13 @@ use execution::process_transaction;
1111use  serde:: Deserialize ; 
1212use  serde_json:: json; 
1313use  std:: { 
14-     ffi:: { c_char,  c_longlong,  c_uchar,  c_ulonglong,  c_void,  CStr ,  CString } , 
15-     slice, 
16-     sync:: Arc , 
1714    collections:: BTreeMap , 
15+     ffi:: { c_char,  c_longlong,  c_uchar,  c_ulonglong,  c_void,  CStr ,  CString } , 
1816    fs:: File , 
1917    io:: Read , 
2018    path:: Path , 
19+     slice, 
20+     sync:: Arc , 
2121} ; 
2222
2323use  anyhow:: Result ; 
@@ -67,8 +67,8 @@ use starknet_api::{
6767use  starknet_types_core:: felt:: Felt ; 
6868use  std:: str:: FromStr ; 
6969type  StarkFelt  = Felt ; 
70- use  once_cell:: sync:: Lazy ; 
7170use  anyhow:: Context ; 
71+ use  once_cell:: sync:: Lazy ; 
7272
7373// Allow users to call CONSTRUCTOR entry point type which has fixed entry_point_felt "0x28ffe4ff0f226a9107253e17a904099aa4f63a02a5621de0576e5aa71bc5194" 
7474pub  static  CONSTRUCTOR_ENTRY_POINT_FELT :  Lazy < StarkFelt >  = Lazy :: new ( || { 
@@ -707,11 +707,14 @@ fn build_block_context(
707707
708708#[ allow( static_mut_refs) ]  
709709fn  get_versioned_constants ( version :  * const  c_char )  -> VersionedConstants  { 
710-     let  starknet_version = unsafe  {  CStr :: from_ptr ( version)  } . to_str ( ) 
710+     let  starknet_version = unsafe  {  CStr :: from_ptr ( version)  } 
711+         . to_str ( ) 
711712        . ok ( ) 
712713        . and_then ( |version_str| StarknetVersion :: try_from ( version_str) . ok ( ) ) ; 
713714
714-     if  let  ( Some ( custom_constants) ,  Some ( version) )  = ( unsafe  {  & CUSTOM_VERSIONED_CONSTANTS  } ,  starknet_version)  { 
715+     if  let  ( Some ( custom_constants) ,  Some ( version) )  =
716+         ( unsafe  {  & CUSTOM_VERSIONED_CONSTANTS  } ,  starknet_version) 
717+     { 
715718        if  let  Some ( constants)  = custom_constants. 0 . get ( & version)  { 
716719            return  constants. clone ( ) ; 
717720        } 
@@ -731,15 +734,18 @@ impl VersionedConstantsMap {
731734        let  mut  result = BTreeMap :: new ( ) ; 
732735
733736        for  ( version,  path)  in  version_with_path { 
734-             let  mut  file = File :: open ( Path :: new ( & path) ) . with_context ( || format ! ( "Failed to open file: {}" ,  path) ) ?; 
737+             let  mut  file = File :: open ( Path :: new ( & path) ) 
738+                 . with_context ( || format ! ( "Failed to open file: {}" ,  path) ) ?; 
735739
736740            let  mut  contents = String :: new ( ) ; 
737-             file. read_to_string ( & mut  contents) . with_context ( || format ! ( "Failed to read contents of file: {}" ,  path) ) ?; 
741+             file. read_to_string ( & mut  contents) 
742+                 . with_context ( || format ! ( "Failed to read contents of file: {}" ,  path) ) ?; 
738743
739-             let  constants:  VersionedConstants  =
740-                 serde_json :: from_str ( & contents ) . with_context ( || format ! ( "Failed to parse JSON in file: {}" ,  path) ) ?; 
744+             let  constants:  VersionedConstants  = serde_json :: from_str ( & contents ) 
745+                 . with_context ( || format ! ( "Failed to parse JSON in file: {}" ,  path) ) ?; 
741746
742-             let  parsed_version = StarknetVersion :: try_from ( version. as_str ( ) ) . with_context ( || format ! ( "Failed to parse version string: {}" ,  version) ) ?; 
747+             let  parsed_version = StarknetVersion :: try_from ( version. as_str ( ) ) 
748+                 . with_context ( || format ! ( "Failed to parse version string: {}" ,  version) ) ?; 
743749
744750            result. insert ( parsed_version,  constants) ; 
745751        } 
@@ -764,19 +770,21 @@ pub extern "C" fn setVersionedConstants(json_bytes: *const c_char) -> *const c_c
764770        } 
765771    } ; 
766772
767-     let  versioned_constants_files_paths:  Result < BTreeMap < String ,  String > ,  _ >  = serde_json:: from_str ( json_str) ; 
773+     let  versioned_constants_files_paths:  Result < BTreeMap < String ,  String > ,  _ >  =
774+         serde_json:: from_str ( json_str) ; 
768775    if  let  Ok ( paths)  = versioned_constants_files_paths { 
769776        match  VersionedConstantsMap :: from_file ( paths)  { 
770-             Ok ( custom_constants)  => { 
771-                 unsafe  { 
772-                     CUSTOM_VERSIONED_CONSTANTS  = Some ( custom_constants) ; 
773-                     return  CString :: new ( "" ) . unwrap ( ) . into_raw ( ) ; 
774-                 } 
777+             Ok ( custom_constants)  => unsafe  { 
778+                 CUSTOM_VERSIONED_CONSTANTS  = Some ( custom_constants) ; 
779+                 return  CString :: new ( "" ) . unwrap ( ) . into_raw ( ) ; 
775780            } , 
776781            Err ( e)  => { 
777-                 return  CString :: new ( format ! ( "Failed to load versioned constants from paths: {}" ,  e) ) 
778-                     . unwrap ( ) 
779-                     . into_raw ( ) ; 
782+                 return  CString :: new ( format ! ( 
783+                     "Failed to load versioned constants from paths: {}" , 
784+                     e
785+                 ) ) 
786+                 . unwrap ( ) 
787+                 . into_raw ( ) ; 
780788            } 
781789        } 
782790    }  else  { 
0 commit comments