Skip to content

Conversation

@cptartur
Copy link
Member

@cptartur cptartur commented Oct 22, 2025

@cptartur cptartur force-pushed the spr/master/b701265d branch from f3341f3 to 975c55c Compare October 23, 2025 13:53
@cptartur cptartur force-pushed the spr/master/30d7f8cd branch from 5be308b to 2fb1cab Compare October 23, 2025 13:53
@cptartur cptartur mentioned this pull request Oct 23, 2025
@cptartur cptartur force-pushed the spr/master/30d7f8cd branch from 2fb1cab to 5f1378b Compare November 7, 2025 11:21
@cptartur cptartur force-pushed the spr/master/b701265d branch from 975c55c to b529f57 Compare November 7, 2025 11:21
@cptartur cptartur force-pushed the spr/master/30d7f8cd branch from 5f1378b to 61e2887 Compare November 7, 2025 11:23
@cptartur cptartur force-pushed the spr/master/b701265d branch from b529f57 to a5347c6 Compare November 7, 2025 11:23
@cptartur cptartur force-pushed the spr/master/30d7f8cd branch from 61e2887 to b6dbc2c Compare November 7, 2025 11:29
@cptartur cptartur force-pushed the spr/master/b701265d branch 2 times, most recently from 275f396 to 12fa2fe Compare November 7, 2025 11:31
@cptartur cptartur force-pushed the spr/master/30d7f8cd branch from b6dbc2c to 7a5f8b2 Compare November 7, 2025 11:31
@cptartur cptartur marked this pull request as ready for review November 7, 2025 11:50
@cptartur cptartur requested a review from a team as a code owner November 7, 2025 11:50
@cptartur cptartur requested review from MKowalski8 and ksew1 and removed request for a team November 7, 2025 11:50
/// use this wrapper to NOT add extra length felt
/// useful e.g. when you need to pass an already serialized value
#[derive(Debug)]
pub struct NoLengthFeltVec<T>(pub Vec<T>)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could name it SerializedValue? As this i think is only usefull if value is serialized

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming

@cptartur cptartur force-pushed the spr/master/b701265d branch from 12fa2fe to f955261 Compare November 12, 2025 12:23
@cptartur cptartur force-pushed the spr/master/30d7f8cd branch from 7a5f8b2 to 69854b2 Compare November 12, 2025 12:23
@cptartur cptartur requested a review from ksew1 November 12, 2025 12:23
commit-id:30d7f8cd
@cptartur cptartur force-pushed the spr/master/30d7f8cd branch from 69854b2 to 45efdc4 Compare November 12, 2025 12:54
impl<T: CairoDeserialize, E: CairoDeserialize> CairoDeserialize for Result<T, E> {
fn deserialize(reader: &mut BufferReader<'_>) -> BufferReadResult<Self> {
let variant: Felt = reader.read()?;
let variant: usize = variant.to_usize().ok_or(BufferReadError::ParseFailed)?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
let variant: usize = variant.to_usize().ok_or(BufferReadError::ParseFailed)?;
let variant = variant.to_usize().ok_or(BufferReadError::ParseFailed)?;

///
/// Use this to omit adding extra felt for the length of the vector during serialization.
#[derive(Debug)]
pub struct SerializedValue<T>(pub Vec<T>)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also drop generic. Only valid representation i would say is pub struct SerializedValue(pub Vec<Felt>)

}
}

impl CairoDeserialize for SerializedValue<Felt> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants