This commit is contained in:
parent
6ab0bc52fc
commit
0541817116
6 changed files with 87 additions and 81 deletions
|
|
@ -46,14 +46,6 @@ impl MockEmptyPod {
|
|||
}
|
||||
Ok(())
|
||||
}
|
||||
pub(crate) fn deserialize(
|
||||
params: Params,
|
||||
id: PodId,
|
||||
_vds_root: Hash,
|
||||
_data: serde_json::Value,
|
||||
) -> Result<Box<dyn RecursivePod>> {
|
||||
Ok(Box::new(Self { params, id }))
|
||||
}
|
||||
}
|
||||
|
||||
impl Pod for MockEmptyPod {
|
||||
|
|
@ -88,6 +80,14 @@ impl RecursivePod for MockEmptyPod {
|
|||
fn vds_root(&self) -> Hash {
|
||||
panic!("MockEmptyPod can't be verified in a recursive MainPod circuit");
|
||||
}
|
||||
fn deserialize_data(
|
||||
params: Params,
|
||||
_data: serde_json::Value,
|
||||
_vds_root: Hash,
|
||||
id: PodId,
|
||||
) -> Result<Box<dyn RecursivePod>, Box<DynError>> {
|
||||
Ok(Box::new(Self { params, id }))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
|
|||
|
|
@ -190,32 +190,6 @@ impl MockMainPod {
|
|||
})
|
||||
}
|
||||
|
||||
// MockMainPods include some internal private state which is necessary
|
||||
// for verification. In non-mock Pods, this state will not be necessary,
|
||||
// as the public statements can be verified using a ZK proof.
|
||||
pub(crate) fn deserialize(
|
||||
params: Params,
|
||||
id: PodId,
|
||||
vds_root: Hash,
|
||||
data: serde_json::Value,
|
||||
) -> Result<Box<dyn RecursivePod>> {
|
||||
let Data {
|
||||
public_statements,
|
||||
operations,
|
||||
statements,
|
||||
merkle_proofs,
|
||||
} = serde_json::from_value(data)?;
|
||||
Ok(Box::new(Self {
|
||||
params,
|
||||
id,
|
||||
vds_root,
|
||||
public_statements,
|
||||
operations,
|
||||
statements,
|
||||
merkle_proofs,
|
||||
}))
|
||||
}
|
||||
|
||||
fn _verify(&self) -> Result<()> {
|
||||
// 1. TODO: Verify input pods
|
||||
|
||||
|
|
@ -331,6 +305,31 @@ impl RecursivePod for MockMainPod {
|
|||
fn vds_root(&self) -> Hash {
|
||||
self.vds_root
|
||||
}
|
||||
// MockMainPods include some internal private state which is necessary
|
||||
// for verification. In non-mock Pods, this state will not be necessary,
|
||||
// as the public statements can be verified using a ZK proof.
|
||||
fn deserialize_data(
|
||||
params: Params,
|
||||
data: serde_json::Value,
|
||||
vds_root: Hash,
|
||||
id: PodId,
|
||||
) -> Result<Box<dyn RecursivePod>, Box<DynError>> {
|
||||
let Data {
|
||||
public_statements,
|
||||
operations,
|
||||
statements,
|
||||
merkle_proofs,
|
||||
} = serde_json::from_value(data)?;
|
||||
Ok(Box::new(Self {
|
||||
params,
|
||||
id,
|
||||
vds_root,
|
||||
public_statements,
|
||||
operations,
|
||||
statements,
|
||||
merkle_proofs,
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue