diff --git a/CHANGELOG.md b/CHANGELOG.md index b0e1be6218..2e9ff54e72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ #### Upcoming Changes +* fix: revert breaking change on public input serialization [#1790](https://github.com/lambdaclass/cairo-vm/pull/1790) + * fix: Handle `GasBuiltin` in cairo1-run crate [#1789](https://github.com/lambdaclass/cairo-vm/pull/1789) * Load `initial_gas` into vm instead of creating it via instructions. * Fix bug affecting programs with input arguments and gas builtin. diff --git a/vm/src/air_public_input.rs b/vm/src/air_public_input.rs index a2e19f56b7..dc33457cb1 100644 --- a/vm/src/air_public_input.rs +++ b/vm/src/air_public_input.rs @@ -34,7 +34,7 @@ mod mem_value_serde { serializer: S, ) -> Result { if let Some(value) = value { - serializer.serialize_str(&format!("{:x}", value)) + serializer.serialize_str(&format!("0x{:x}", value)) } else { serializer.serialize_none() } @@ -66,6 +66,7 @@ mod mem_value_serde { where E: de::Error, { + let value = value.strip_prefix("0x").unwrap_or(value); Felt252::from_hex(value) .map_err(de::Error::custom) .map(Some)