@@ -15,6 +15,7 @@ use pathfinder_common::class_definition::{
1515 ClassDefinition as GwClassDefinition ,
1616 SerializedCairoDefinition ,
1717 SerializedCasmDefinition ,
18+ SerializedClassDefinition ,
1819 SerializedSierraDefinition ,
1920 Sierra ,
2021} ;
@@ -37,22 +38,16 @@ use crate::sync::stream::ProcessStage;
3738#[ derive( Debug ) ]
3839pub struct ClassWithLayout {
3940 pub block_number : BlockNumber ,
40- pub definition : ClassDefinition ,
41+ pub definition : SerializedClassDefinition ,
4142 pub layout : GwClassDefinition < ' static > ,
4243 pub hash : ClassHash ,
4344}
4445
45- #[ derive( Debug ) ]
46- pub ( super ) enum ClassDefinition {
47- Cairo ( SerializedCairoDefinition ) ,
48- Sierra ( SerializedSierraDefinition ) ,
49- }
50-
5146#[ derive( Debug ) ]
5247pub struct Class {
5348 pub block_number : BlockNumber ,
5449 pub hash : ClassHash ,
55- pub definition : ClassDefinition ,
50+ pub definition : SerializedClassDefinition ,
5651}
5752
5853#[ derive( Debug ) ]
@@ -157,7 +152,7 @@ fn verify_layout_impl(
157152 ) ;
158153 Ok ( ClassWithLayout {
159154 block_number,
160- definition : ClassDefinition :: Cairo ( definition) ,
155+ definition : SerializedClassDefinition :: Cairo ( definition) ,
161156 layout,
162157 hash,
163158 } )
@@ -177,7 +172,7 @@ fn verify_layout_impl(
177172 ) ;
178173 Ok ( ClassWithLayout {
179174 block_number,
180- definition : ClassDefinition :: Sierra ( sierra_definition) ,
175+ definition : SerializedClassDefinition :: Sierra ( sierra_definition) ,
181176 layout,
182177 hash : ClassHash ( hash. 0 ) ,
183178 } )
@@ -513,8 +508,8 @@ fn compile_or_fetch_impl<SequencerClient: GatewayApi + Clone + Send + 'static>(
513508 } = class;
514509
515510 let definition = match definition {
516- ClassDefinition :: Cairo ( c) => CompiledClassDefinition :: Cairo ( c) ,
517- ClassDefinition :: Sierra ( sierra_definition) => {
511+ SerializedClassDefinition :: Cairo ( c) => CompiledClassDefinition :: Cairo ( c) ,
512+ SerializedClassDefinition :: Sierra ( sierra_definition) => {
518513 let casm_definition = pathfinder_compiler:: compile_sierra_to_casm (
519514 & sierra_definition,
520515 compiler_resource_limits,
0 commit comments