Skip to content

Commit

Permalink
fix(v2): serde decoding error for `PicklesProofProofsVerified2ReprSta…
Browse files Browse the repository at this point in the history
…bleV2StatementFp`
  • Loading branch information
binier committed Aug 17, 2023
1 parent 73ba1ac commit 84743ea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/bigint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ impl<'de> Deserialize<'de> for BigInt {
formatter.write_str("sequence of 32 bytes")
}

fn visit_borrowed_bytes<E>(self, v: &'de [u8]) -> Result<Self::Value, E>
fn visit_bytes<E>(self, v: &[u8]) -> Result<Self::Value, E>
where
E: serde::de::Error,
{
Expand Down
8 changes: 7 additions & 1 deletion src/v2/manual.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,13 @@ impl<'de> Deserialize<'de> for PicklesProofProofsVerified2ReprStableV2StatementF
if deserializer.is_human_readable() {
deserializer.deserialize_tuple(2, V)
} else {
Ok(Self::ShiftedValue(Deserialize::deserialize(deserializer)?))
#[derive(Deserialize)]
pub enum PicklesProofProofsVerified2ReprStableV2StatementFp {
ShiftedValue(crate::bigint::BigInt),
}
let PicklesProofProofsVerified2ReprStableV2StatementFp::ShiftedValue(v) =
Deserialize::deserialize(deserializer)?;
Ok(Self::ShiftedValue(v))
}
}
}
Expand Down

0 comments on commit 84743ea

Please sign in to comment.