11use anyhow:: Result ;
22
33use crate :: artifacts:: representation:: StarknetArtifactsRepresentation ;
4+ use cairo_lang_starknet_classes:: casm_contract_class:: CasmContractClass ;
45#[ cfg( feature = "cairo-native" ) ]
56use cairo_native:: executor:: AotContractExecutor ;
67use camino:: { Utf8Path , Utf8PathBuf } ;
@@ -19,7 +20,7 @@ pub struct StarknetContractArtifacts {
1920 /// Compiled sierra code
2021 pub sierra : String ,
2122 /// Compiled casm code
22- pub casm : String ,
23+ pub casm : CasmContractClass ,
2324
2425 #[ cfg( feature = "cairo-native" ) ]
2526 /// Optional AOT compiled native executor
@@ -106,7 +107,7 @@ impl StarknetArtifactsFiles {
106107 fn compile_artifact_at_path ( & self , path : & Utf8Path ) -> Result < StarknetContractArtifacts > {
107108 let sierra = fs:: read_to_string ( path) ?;
108109
109- let casm = serde_json :: to_string ( & compile_contract_sierra_at_path ( path) ? ) ?;
110+ let casm = compile_contract_sierra_at_path ( path) ?;
110111
111112 #[ cfg( feature = "cairo-native" ) ]
112113 let executor = self . compile_to_native ( & sierra) ?;
@@ -153,9 +154,11 @@ mod tests {
153154 use crate :: tests:: setup_package;
154155 use assert_fs:: TempDir ;
155156 use assert_fs:: fixture:: { FileWriteStr , PathChild } ;
157+ use cairo_lang_starknet_classes:: casm_contract_class:: CasmContractEntryPoints ;
156158 use camino:: Utf8PathBuf ;
157159 use deserialized:: { StarknetArtifacts , StarknetContract , StarknetContractArtifactPaths } ;
158160 use indoc:: indoc;
161+ use num_bigint:: BigUint ;
159162
160163 #[ test]
161164 fn test_unique_artifacts ( ) {
@@ -165,7 +168,15 @@ mod tests {
165168 (
166169 StarknetContractArtifacts {
167170 sierra : "sierra1" . to_string ( ) ,
168- casm : "casm1" . to_string ( ) ,
171+ casm : CasmContractClass {
172+ prime : BigUint :: default ( ) ,
173+ compiler_version : String :: default ( ) ,
174+ bytecode : vec ! [ ] ,
175+ bytecode_segment_lengths : None ,
176+ hints : vec ! [ ] ,
177+ pythonic_hints : None ,
178+ entry_points_by_type : CasmContractEntryPoints :: default ( ) ,
179+ } ,
169180 #[ cfg( feature = "cairo-native" ) ]
170181 executor : None ,
171182 } ,
0 commit comments