11use std:: collections:: { HashMap , HashSet } ;
2- use std:: fs;
3- use std:: path:: Path ;
42
53// TODO(Amos): When available in the VM crate, use an existing set, instead of using each hint
64// const explicitly.
@@ -199,13 +197,10 @@ use cairo_vm::hint_processor::builtin_hint_processor::hint_code::{
199197} ;
200198use starknet_os:: hints:: enum_definition:: { AggregatorHint , HintExtension , OsHint } ;
201199use starknet_os:: hints:: types:: HintEnum ;
202- use starknet_os:: io:: os_output:: StarknetOsRunnerOutput ;
203- use starknet_os:: runner:: run_os_stateless;
204200use starknet_os:: test_utils:: cairo_runner:: EntryPointRunnerConfig ;
205201use strum:: IntoEnumIterator ;
206202
207203use crate :: os_cli:: commands:: { validate_input, Input } ;
208- use crate :: os_cli:: run_os_cli:: OsCliOutput ;
209204use crate :: os_cli:: tests:: aliases:: aliases_test;
210205use crate :: os_cli:: tests:: bls_field:: test_bls_field;
211206use crate :: os_cli:: tests:: types:: { OsPythonTestError , OsPythonTestResult , OsSpecificTestError } ;
@@ -219,7 +214,6 @@ pub enum OsPythonTestRunner {
219214 CompareOsHints ,
220215 InputDeserialization ,
221216 RunDummyFunction ,
222- RunOsFlowTest ,
223217}
224218
225219// Implements conversion from a string to the test runner.
@@ -233,7 +227,6 @@ impl TryFrom<String> for OsPythonTestRunner {
233227 "compare_os_hints" => Ok ( Self :: CompareOsHints ) ,
234228 "input_deserialization" => Ok ( Self :: InputDeserialization ) ,
235229 "run_dummy_function" => Ok ( Self :: RunDummyFunction ) ,
236- "run_os_flow_test" => Ok ( Self :: RunOsFlowTest ) ,
237230 _ => Err ( PythonTestError :: UnknownTestName ( value) ) ,
238231 }
239232 }
@@ -248,7 +241,6 @@ impl PythonTestRunner for OsPythonTestRunner {
248241 Self :: CompareOsHints => compare_os_hints ( Self :: non_optional_input ( input) ?) ,
249242 Self :: InputDeserialization => input_deserialization ( Self :: non_optional_input ( input) ?) ,
250243 Self :: RunDummyFunction => run_dummy_cairo_function ( Self :: non_optional_input ( input) ?) ,
251- Self :: RunOsFlowTest => run_os_flow_test ( Self :: non_optional_input ( input) ?) ,
252244 }
253245 }
254246}
@@ -611,20 +603,3 @@ else:
611603 value = (-y) % SECP256R1.prime"# ,
612604 ] )
613605}
614- // TODO(Nimrod): Remove this python test and run the os directly with `parse_and_run_os`.
615- /// Runs the OS with the given input and returns the deserialized output.
616- fn run_os_flow_test ( input : & str ) -> OsPythonTestResult {
617- let Input { layout, compiled_os_path, os_hints, cairo_pie_zip_path } =
618- serde_json:: from_str ( input) ?;
619- // Load the compiled_os from the compiled_os_path.
620- let compiled_os =
621- fs:: read ( Path :: new ( & compiled_os_path) ) . expect ( "Failed to read compiled_os file" ) ;
622- let StarknetOsRunnerOutput { os_output, cairo_pie, unused_hints } =
623- run_os_stateless ( & compiled_os, layout, os_hints) ?;
624- let merge_extra_segments = false ;
625- cairo_pie
626- . write_zip_file ( Path :: new ( & cairo_pie_zip_path) , merge_extra_segments)
627- . expect ( "Failed to write cairo pie." ) ;
628- let output = OsCliOutput { os_output, unused_hints } ;
629- Ok ( serde_json:: to_string ( & output) ?)
630- }
0 commit comments