Serialization of Signed and Main Pods (#128)

This commit is contained in:
Rob Knight 2025-03-21 14:42:16 +01:00 committed by GitHub
parent fee70af12b
commit 9afc43675d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 817 additions and 189 deletions

View file

@ -44,6 +44,16 @@ pub struct MockSignedPod {
dict: Dictionary,
}
impl MockSignedPod {
pub fn deserialize(id: PodId, signature: String, dict: Dictionary) -> Self {
Self {
id,
signature,
dict,
}
}
}
impl Pod for MockSignedPod {
fn verify(&self) -> bool {
// 1. Verify type
@ -100,6 +110,10 @@ impl Pod for MockSignedPod {
fn into_any(self: Box<Self>) -> Box<dyn Any> {
self
}
fn serialized_proof(&self) -> String {
self.signature.to_string()
}
}
#[cfg(test)]