You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to be able to reconstruct the PrimeField and also be able to store it in a db/text file or any other thing so that if my node goes down I'm able to recover my Field.
Serde doesn't automatically serialize the PrimeField, so I'm trying to write a custom serializer but not able to figure out. I think my serializer is working but can't figure out deserializer.
pub fn serialize<S, T>(field: &T, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
T: PrimeField,
{
let bytes = field.to_repr();
let bits = bytes.as_bits::<Lsb0>();
let str = bits.to_string();
serializer.serialize_str(&str)
}
Would appreciate help writing a deserializer as well. Thanks for the help!
The text was updated successfully, but these errors were encountered:
I want to be able to reconstruct the PrimeField and also be able to store it in a db/text file or any other thing so that if my node goes down I'm able to recover my Field.
Serde doesn't automatically serialize the PrimeField, so I'm trying to write a custom serializer but not able to figure out. I think my serializer is working but can't figure out deserializer.
Would appreciate help writing a deserializer as well. Thanks for the help!
The text was updated successfully, but these errors were encountered: