Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make AirPublicInputs fields public #1474

Merged
merged 4 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading