diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e04a5fcb3..88f3e4b959 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ * chore: bump pip `cairo-lang` 0.13.3 [#1884](https://github.com/lambdaclass/cairo-vm/pull/1884) +* chore: [#1880](https://github.com/lambdaclass/cairo-vm/pull/1880): + * Refactor vm crate to make it possible to use hint extension feature for nested programs with hints. + #### [2.0.0-rc1] - 2024-11-20 * feat: add `EvalCircuit` and `TestLessThanOrEqualAddress` hints [#1843](https://github.com/lambdaclass/cairo-vm/pull/1843) diff --git a/vm/src/types/program.rs b/vm/src/types/program.rs index 477f996577..1c97580ee0 100644 --- a/vm/src/types/program.rs +++ b/vm/src/types/program.rs @@ -60,9 +60,9 @@ use arbitrary::{Arbitrary, Unstructured}; // failures. // Fields in `Program` (other than `SharedProgramData` itself) are used by the main logic. #[derive(Clone, Default, Debug, PartialEq, Eq)] -pub(crate) struct SharedProgramData { +pub struct SharedProgramData { pub(crate) data: Vec, - pub(crate) hints_collection: HintsCollection, + pub hints_collection: HintsCollection, pub(crate) main: Option, //start and end labels will only be used in proof-mode pub(crate) start: Option, @@ -70,7 +70,7 @@ pub(crate) struct SharedProgramData { pub(crate) error_message_attributes: Vec, pub(crate) instruction_locations: Option>, pub(crate) identifiers: HashMap, - pub(crate) reference_manager: Vec, + pub reference_manager: Vec, } #[cfg(feature = "test_utils")] @@ -107,13 +107,13 @@ impl<'a> Arbitrary<'a> for SharedProgramData { } #[derive(Clone, Default, Debug, PartialEq, Eq)] -pub(crate) struct HintsCollection { - hints: Vec, +pub struct HintsCollection { + pub hints: Vec, /// This maps a PC to the range of hints in `hints` that correspond to it. #[cfg(not(feature = "extensive_hints"))] pub(crate) hints_ranges: Vec, #[cfg(feature = "extensive_hints")] - pub(crate) hints_ranges: HashMap, + pub hints_ranges: HashMap, } impl HintsCollection { @@ -200,8 +200,8 @@ pub type HintRange = (usize, NonZeroUsize); #[cfg_attr(feature = "test_utils", derive(Arbitrary))] #[derive(Clone, Debug, PartialEq, Eq)] pub struct Program { - pub(crate) shared_program_data: Arc, - pub(crate) constants: HashMap, + pub shared_program_data: Arc, + pub constants: HashMap, pub(crate) builtins: Vec, }