@@ -150,6 +150,10 @@ struct CompiledClassBuildInputs<'a> {
150150 accessed_classes : & ' a HashSet < Felt252 > ,
151151}
152152
153+ type AddressBlockLookup = ( Felt252 , BlockId , bool ) ;
154+ type AddressClassFetch = ( Felt252 , BlockId , bool , Felt ) ;
155+ type AddressClassFetchPlan = ( Vec < AddressBlockLookup > , Vec < AddressClassFetch > ) ;
156+
153157/// Result containing processed contract class data.
154158pub struct ContractClassProcessingResult {
155159 pub compiled_classes : std:: collections:: BTreeMap <
@@ -324,7 +328,7 @@ fn plan_accessed_address_class_fetches(
324328 pre_state_class_hashes : & HashMap < Felt252 , ClassHash > ,
325329 previous_block_id : PreviousBlockId ,
326330 block_id : BlockId ,
327- ) -> ( Vec < ( Felt252 , BlockId , bool ) > , Vec < ( Felt252 , BlockId , bool , Felt ) > ) {
331+ ) -> AddressClassFetchPlan {
328332 let mut address_block_pairs = Vec :: new ( ) ;
329333 let mut class_fetch_pairs = Vec :: new ( ) ;
330334
@@ -422,12 +426,8 @@ async fn process_accessed_addresses(
422426
423427 // Phase 1: Reuse pre-state class hashes from Blockifier when available, and only hit RPC
424428 // for the remaining previous-block lookups plus all current-block lookups.
425- let ( address_block_pairs, mut class_fetch_pairs) = plan_accessed_address_class_fetches (
426- & addresses_to_process,
427- pre_state_class_hashes,
428- previous_block_id,
429- block_id,
430- ) ;
429+ let ( address_block_pairs, mut class_fetch_pairs) =
430+ plan_accessed_address_class_fetches ( & addresses_to_process, pre_state_class_hashes, previous_block_id, block_id) ;
431431
432432 let class_hash_results: Vec < ( Felt252 , BlockId , bool , Result < Felt , ProviderError > ) > =
433433 stream:: iter ( address_block_pairs)
@@ -654,6 +654,15 @@ fn compile_contract_class(
654654 Ok ( compiled_class)
655655}
656656
657+ /// Formats declared classes for OS consumption by setting compiled class hashes to zero.
658+ fn format_declared_classes ( state_diff : & StateDiff , class_hash_to_compiled_class_hash : & mut HashMap < Felt252 , Felt252 > ) {
659+ debug ! ( "Formatting {} declared classes" , state_diff. declared_classes. len( ) ) ;
660+
661+ for class in & state_diff. declared_classes {
662+ class_hash_to_compiled_class_hash. insert ( class. class_hash , Felt :: ZERO ) ;
663+ }
664+ }
665+
657666#[ cfg( test) ]
658667mod tests {
659668 use super :: * ;
@@ -696,12 +705,3 @@ mod tests {
696705 assert_eq ! ( address_block_pairs, vec![ ( address, block_id, false ) ] ) ;
697706 }
698707}
699-
700- /// Formats declared classes for OS consumption by setting compiled class hashes to zero.
701- fn format_declared_classes ( state_diff : & StateDiff , class_hash_to_compiled_class_hash : & mut HashMap < Felt252 , Felt252 > ) {
702- debug ! ( "Formatting {} declared classes" , state_diff. declared_classes. len( ) ) ;
703-
704- for class in & state_diff. declared_classes {
705- class_hash_to_compiled_class_hash. insert ( class. class_hash , Felt :: ZERO ) ;
706- }
707- }
0 commit comments