From 3a8102e5b1789403805d4a6c3c73e398af2725f3 Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Sun, 2 Jun 2024 15:11:06 -0700 Subject: [PATCH 1/6] chore: derive default --- core/src/io.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/io.rs b/core/src/io.rs index b07643bbd3..d5271c12ef 100644 --- a/core/src/io.rs +++ b/core/src/io.rs @@ -7,7 +7,7 @@ use num_bigint::BigUint; use serde::{de::DeserializeOwned, Deserialize, Serialize}; /// Standard input for the prover. -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct SP1Stdin { /// Input stored as a vec of vec of bytes. It's stored this way because the read syscall reads /// a vec of bytes at a time. From 28d1ecd7110afa533d9c40cbcc7b7175e5a3e402 Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Sun, 2 Jun 2024 15:25:01 -0700 Subject: [PATCH 2/6] default --- core/src/io.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/io.rs b/core/src/io.rs index d5271c12ef..9624c1c771 100644 --- a/core/src/io.rs +++ b/core/src/io.rs @@ -20,7 +20,7 @@ pub struct SP1Stdin { } /// Public values for the prover. -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct SP1PublicValues { buffer: Buffer, } From 97d3bba21ec7647b5a66fed809b89e23461e58a1 Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Sun, 2 Jun 2024 15:34:45 -0700 Subject: [PATCH 3/6] core fix --- core/src/io.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/io.rs b/core/src/io.rs index 9624c1c771..43542afb72 100644 --- a/core/src/io.rs +++ b/core/src/io.rs @@ -45,7 +45,7 @@ impl SP1Stdin { } /// Read a value from the buffer. - pub fn read(&mut self) -> T { + pub fn read(&mut self) -> T { let result: T = bincode::deserialize(&self.buffer[self.ptr]).expect("failed to deserialize"); self.ptr += 1; From 699f0b8cdfe5982a58bd343bb74e386fb0c36f19 Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Sun, 2 Jun 2024 15:36:42 -0700 Subject: [PATCH 4/6] fix --- core/src/io.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/io.rs b/core/src/io.rs index 43542afb72..2c4a87953c 100644 --- a/core/src/io.rs +++ b/core/src/io.rs @@ -121,7 +121,7 @@ impl SP1PublicValues { } /// Write a value to the buffer. - pub fn write(&mut self, data: &T) { + pub fn write(&mut self, data: &T) { self.buffer.write(data); } From b5b14cd408b2828c7abeee88d0904720e9e46c20 Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Sun, 2 Jun 2024 16:18:59 -0700 Subject: [PATCH 5/6] lint --- core/src/io.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/core/src/io.rs b/core/src/io.rs index 2c4a87953c..9fd1acc846 100644 --- a/core/src/io.rs +++ b/core/src/io.rs @@ -114,7 +114,6 @@ impl SP1PublicValues { pub fn read(&mut self) -> T { self.buffer.read() } - /// Read a slice of bytes from the buffer. pub fn read_slice(&mut self, slice: &mut [u8]) { self.buffer.read_slice(slice); From 62cbfda2f2eee4905cf12ece1d2da626bcfb3b6e Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Sun, 2 Jun 2024 16:19:06 -0700 Subject: [PATCH 6/6] lint --- core/src/io.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/io.rs b/core/src/io.rs index 9fd1acc846..2c4a87953c 100644 --- a/core/src/io.rs +++ b/core/src/io.rs @@ -114,6 +114,7 @@ impl SP1PublicValues { pub fn read(&mut self) -> T { self.buffer.read() } + /// Read a slice of bytes from the buffer. pub fn read_slice(&mut self, slice: &mut [u8]) { self.buffer.read_slice(slice);