Serialization of Signed and Main Pods (#128)
This commit is contained in:
parent
fee70af12b
commit
9afc43675d
16 changed files with 817 additions and 189 deletions
|
|
@ -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)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue