From d4c96d270da0201667e056377f398bd5815a901b Mon Sep 17 00:00:00 2001 From: Ori Ziv Date: Thu, 18 Apr 2024 20:12:44 +0300 Subject: [PATCH] Made segment finalization happen in empty dicts as well. --- .../cairo_1_hint_processor/hint_processor.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/vm/src/hint_processor/cairo_1_hint_processor/hint_processor.rs b/vm/src/hint_processor/cairo_1_hint_processor/hint_processor.rs index 5657295b93..5f68c9d1e1 100644 --- a/vm/src/hint_processor/cairo_1_hint_processor/hint_processor.rs +++ b/vm/src/hint_processor/cairo_1_hint_processor/hint_processor.rs @@ -390,10 +390,11 @@ impl Cairo1HintProcessor { let dict_manager_exec_scope = exec_scopes.get_mut_ref::("dict_manager_exec_scope")?; - // The hint is only for dictionary finalization, so can be called. let dict_infos_index = dict_manager_exec_scope.get_dict_infos_index(dict_address)?; vm.insert_value(cell_ref_to_relocatable(dict_index, vm)?, dict_infos_index) - .map_err(HintError::from) + .map_err(HintError::from)?; + // The hint is only for dictionary finalization, so can be called. + dict_manager_exec_scope.finalize_segment(vm, dict_address) } #[allow(clippy::too_many_arguments)] @@ -949,9 +950,6 @@ impl Cairo1HintProcessor { HintError::CustomHint("No current key".to_string().into_boxed_str()) })?, )?; - exec_scopes - .get_mut_ref::("dict_manager_exec_scope")? - .finalize_segment(vm, (dict_accesses_address + (n_accesses * 3))?) } fn alloc_constant_size(