@@ -391,10 +391,8 @@ pub fn split_felt(
391391 . ok_or_else ( || HintError :: AssertionFailed ( msg. to_string ( ) . into_boxed_str ( ) ) )
392392 } ;
393393 let bound = pow2_const ( 128 ) ;
394-
395394 let max_high = get_constant_from_var_name ( "MAX_HIGH" , constants) ?;
396395 let max_low = get_constant_from_var_name ( "MAX_LOW" , constants) ?;
397-
398396 assert (
399397 max_high < & bound && max_low < & bound,
400398 "assert ids.MAX_HIGH < 2**128 and ids.MAX_LOW < 2**128" ,
@@ -754,7 +752,6 @@ pub fn split_xx(
754752#[ cfg( test) ]
755753mod tests {
756754 use super :: * ;
757- use crate :: stdlib:: rc:: Rc ;
758755 use crate :: { felt_hex, felt_str} ;
759756 use core:: ops:: Neg ;
760757
@@ -2065,22 +2062,20 @@ mod tests {
20652062 HintReference :: new ( -3 , 1 , true , true , true ) ,
20662063 ) ,
20672064 ] ) ;
2068- let identifiers = HashMap :: from ( [
2069- ( "MAX_LOW" . to_string ( ) , Felt252 :: ZERO ) ,
2070- (
2071- "MAX_HIGH" . to_string ( ) ,
2072- felt_str ! ( "10633823966279327296825105735305134080" ) ,
2073- ) ,
2074- ] ) ;
20752065 //Execute the hint
20762066 assert_matches ! (
20772067 run_hint!(
20782068 vm,
20792069 ids_data,
20802070 hint_code,
20812071 exec_scopes_ref!( ) ,
2082- & HashMap :: default ( ) ,
2083- identifiers
2072+ & HashMap :: from( [
2073+ ( "MAX_LOW" . to_string( ) , Felt252 :: ZERO ) ,
2074+ (
2075+ "MAX_HIGH" . to_string( ) ,
2076+ felt_str!( "10633823966279327296825105735305134080" )
2077+ )
2078+ ] )
20842079 ) ,
20852080 Ok ( ( ) )
20862081 ) ;
@@ -2107,24 +2102,20 @@ mod tests {
21072102 //Create incomplete ids
21082103 //Create ids_data & hint_data
21092104 let ids_data = ids_data ! [ "low" ] ;
2110-
2111- let identifiers = HashMap :: from ( [
2112- ( "MAX_LOW" . to_string ( ) , Felt252 :: ZERO ) ,
2113- (
2114- "MAX_HIGH" . to_string ( ) ,
2115- felt_str ! ( "10633823966279327296825105735305134080" ) ,
2116- ) ,
2117- ] ) ;
2118-
21192105 //Execute the hint
21202106 assert_matches ! (
21212107 run_hint!(
21222108 vm,
21232109 ids_data,
21242110 hint_code,
21252111 exec_scopes_ref!( ) ,
2126- & HashMap :: default ( ) ,
2127- identifiers
2112+ & HashMap :: from( [
2113+ ( "MAX_LOW" . to_string( ) , Felt252 :: ZERO ) ,
2114+ (
2115+ "MAX_HIGH" . to_string( ) ,
2116+ felt_str!( "10633823966279327296825105735305134080" )
2117+ )
2118+ ] )
21282119 ) ,
21292120 Err ( HintError :: UnknownIdentifier ( bx) ) if bx. as_ref( ) == "value"
21302121 ) ;
@@ -2156,23 +2147,20 @@ mod tests {
21562147 ) ,
21572148 ] ) ;
21582149
2159- let identifiers = HashMap :: from ( [
2160- ( "MAX_LOW" . to_string ( ) , Felt252 :: ZERO ) ,
2161- (
2162- "MAX_HIGH" . to_string ( ) ,
2163- felt_str ! ( "10633823966279327296825105735305134080" ) ,
2164- ) ,
2165- ] ) ;
2166-
21672150 //Execute the hint
21682151 assert_matches ! (
21692152 run_hint!(
21702153 vm,
21712154 ids_data,
21722155 hint_code,
21732156 exec_scopes_ref!( ) ,
2174- & HashMap :: default ( ) ,
2175- identifiers
2157+ & HashMap :: from( [
2158+ ( "MAX_LOW" . to_string( ) , Felt252 :: ZERO ) ,
2159+ (
2160+ "MAX_HIGH" . to_string( ) ,
2161+ felt_str!( "10633823966279327296825105735305134080" )
2162+ )
2163+ ] )
21762164 ) ,
21772165 Err ( HintError :: Memory (
21782166 MemoryError :: InconsistentMemory ( bx)
@@ -2208,24 +2196,20 @@ mod tests {
22082196 HintReference :: new ( -3 , 1 , true , true , true ) ,
22092197 ) ,
22102198 ] ) ;
2211-
2212- let identifiers = HashMap :: from ( [
2213- ( "MAX_LOW" . to_string ( ) , Felt252 :: ZERO ) ,
2214- (
2215- "MAX_HIGH" . to_string ( ) ,
2216- felt_str ! ( "10633823966279327296825105735305134080" ) ,
2217- ) ,
2218- ] ) ;
2219-
22202199 //Execute the hint
22212200 assert_matches ! (
22222201 run_hint!(
22232202 vm,
22242203 ids_data,
22252204 hint_code,
22262205 exec_scopes_ref!( ) ,
2227- & HashMap :: default ( ) ,
2228- identifiers
2206+ & HashMap :: from( [
2207+ ( "MAX_LOW" . to_string( ) , Felt252 :: ZERO ) ,
2208+ (
2209+ "MAX_HIGH" . to_string( ) ,
2210+ felt_str!( "10633823966279327296825105735305134080" )
2211+ )
2212+ ] )
22292213 ) ,
22302214 Err ( HintError :: Memory (
22312215 MemoryError :: InconsistentMemory ( bx)
@@ -2256,22 +2240,20 @@ mod tests {
22562240 HintReference :: new ( -3 , 1 , true , true , true ) ,
22572241 ) ,
22582242 ] ) ;
2259- let identifiers = HashMap :: from ( [
2260- ( "MAX_LOW" . to_string ( ) , Felt252 :: ZERO ) ,
2261- (
2262- "MAX_HIGH" . to_string ( ) ,
2263- felt_str ! ( "10633823966279327296825105735305134080" ) ,
2264- ) ,
2265- ] ) ;
22662243 //Execute the hint
22672244 assert_matches ! (
22682245 run_hint!(
22692246 vm,
22702247 ids_data,
22712248 hint_code,
22722249 exec_scopes_ref!( ) ,
2273- & HashMap :: default ( ) ,
2274- identifiers
2250+ & HashMap :: from( [
2251+ ( "MAX_LOW" . to_string( ) , Felt252 :: ZERO ) ,
2252+ (
2253+ "MAX_HIGH" . to_string( ) ,
2254+ felt_str!( "10633823966279327296825105735305134080" )
2255+ )
2256+ ] )
22752257 ) ,
22762258 Err ( HintError :: IdentifierNotInteger ( bx) ) if bx. as_ref( ) == "value"
22772259 ) ;
@@ -2334,21 +2316,20 @@ mod tests {
23342316 HintReference :: new ( -3 , 1 , true , true , true ) ,
23352317 ) ,
23362318 ] ) ;
2337-
2338- let identifiers = HashMap :: from ( [
2339- ( "a.MAX_LOW" . to_string ( ) , Felt252 :: from ( -1 ) ) ,
2340- ( "a.MAX_HIGH" . to_string ( ) , Felt252 :: from ( -1 ) ) ,
2341- ] ) ;
2342-
23432319 //Execute the hint
23442320 assert_matches ! (
23452321 run_hint!(
23462322 vm,
23472323 ids_data,
23482324 hint_code,
23492325 exec_scopes_ref!( ) ,
2350- & HashMap :: default ( ) ,
2351- identifiers
2326+ & HashMap :: from( [
2327+ ( "MAX_LOW" . to_string( ) , Felt252 :: from( -1 ) ) ,
2328+ (
2329+ "MAX_HIGH" . to_string( ) ,
2330+ Felt252 :: from( -1 ) ,
2331+ )
2332+ ] )
23522333 ) ,
23532334 Err ( HintError :: AssertionFailed ( x) ) if & ( * x) == "assert ids.MAX_HIGH < 2**128 and ids.MAX_LOW < 2**128"
23542335 ) ;
@@ -2379,21 +2360,20 @@ mod tests {
23792360 HintReference :: new ( -3 , 1 , true , true , true ) ,
23802361 ) ,
23812362 ] ) ;
2382-
2383- let identifiers = HashMap :: from ( [
2384- ( "MAX_LOW" . to_string ( ) , Felt252 :: ZERO ) ,
2385- ( "MAX_HIGH" . to_string ( ) , Felt252 :: ZERO ) ,
2386- ] ) ;
2387-
23882363 //Execute the hint
23892364 assert_matches ! (
23902365 run_hint!(
23912366 vm,
23922367 ids_data,
23932368 hint_code,
23942369 exec_scopes_ref!( ) ,
2395- & HashMap :: default ( ) ,
2396- identifiers
2370+ & HashMap :: from( [
2371+ ( "MAX_LOW" . to_string( ) , Felt252 :: ZERO ) ,
2372+ (
2373+ "MAX_HIGH" . to_string( ) ,
2374+ Felt252 :: ZERO ,
2375+ )
2376+ ] )
23972377 ) ,
23982378 Err ( HintError :: AssertionFailed ( x) ) if & ( * x) == "assert PRIME - 1 == ids.MAX_HIGH * 2**128 + ids.MAX_LOW"
23992379 ) ;
0 commit comments