Skip to content

Commit

Permalink
Make AirPublicInputs fields public (#1474)
Browse files Browse the repository at this point in the history
* Make AirPublicInputs fields public

* make private the layout_params field

* update CHANGELOG.md
  • Loading branch information
pefontana authored Nov 14, 2023
1 parent 74fa49a commit 6d832f3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#### Upcoming Changes

* feat: Make PublicInput fields public [#1474](https://github.com/lambdaclass/cairo-vm/pull/1474)

* chore: bump starknet-crypto to v0.6.1 [#1469](https://github.com/lambdaclass/cairo-vm/pull/1469)

* feat: Implement the Serialize and Deserialize methods for the Program struct [#1458](https://github.com/lambdaclass/cairo-vm/pull/1458)
Expand Down
24 changes: 12 additions & 12 deletions vm/src/air_public_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ use crate::{

#[derive(Serialize, Debug)]
pub struct PublicMemoryEntry {
address: usize,
pub address: usize,
#[serde(serialize_with = "mem_value_serde::serialize")]
value: Option<Felt252>,
page: usize,
pub value: Option<Felt252>,
pub page: usize,
}

mod mem_value_serde {
Expand All @@ -39,9 +39,9 @@ mod mem_value_serde {
}

#[derive(Serialize, Debug)]
struct MemorySegmentAddresses {
begin_addr: usize,
stop_ptr: usize,
pub struct MemorySegmentAddresses {
pub begin_addr: usize,
pub stop_ptr: usize,
}

impl From<(usize, usize)> for MemorySegmentAddresses {
Expand All @@ -56,12 +56,12 @@ impl From<(usize, usize)> for MemorySegmentAddresses {

#[derive(Serialize, Debug)]
pub struct PublicInput<'a> {
layout: &'a str,
rc_min: isize,
rc_max: isize,
n_steps: usize,
memory_segments: HashMap<&'a str, MemorySegmentAddresses>,
public_memory: Vec<PublicMemoryEntry>,
pub layout: &'a str,
pub rc_min: isize,
pub rc_max: isize,
pub n_steps: usize,
pub memory_segments: HashMap<&'a str, MemorySegmentAddresses>,
pub public_memory: Vec<PublicMemoryEntry>,
#[serde(rename = "dynamic_params")]
layout_params: Option<&'a CairoLayout>,
}
Expand Down

0 comments on commit 6d832f3

Please sign in to comment.