MainPod circuit skeleton (#151)
* feat: add MainPod circuit skeleton * feat: use ValueTarget in mt, verify SignedPod type * wip * feat: match structure with mock * apply feedback from @arnaucube * add 2 operations * fix test compilation * Add missing todo
This commit is contained in:
parent
2a2628ccbf
commit
22db6ce4c6
6 changed files with 513 additions and 51 deletions
|
|
@ -46,7 +46,7 @@ pub struct MockSignedPod {
|
|||
|
||||
impl Pod for MockSignedPod {
|
||||
fn verify(&self) -> bool {
|
||||
// Verify type
|
||||
// 1. Verify type
|
||||
let value_at_type = match self.dict.get(&hash_str(KEY_TYPE).into()) {
|
||||
Ok(v) => v,
|
||||
Err(_) => return false,
|
||||
|
|
@ -55,7 +55,7 @@ impl Pod for MockSignedPod {
|
|||
return false;
|
||||
}
|
||||
|
||||
// Verify id
|
||||
// 2. Verify id
|
||||
let mt = match MerkleTree::new(
|
||||
MAX_DEPTH,
|
||||
&self
|
||||
|
|
@ -72,7 +72,7 @@ impl Pod for MockSignedPod {
|
|||
return false;
|
||||
}
|
||||
|
||||
// Verify signature
|
||||
// 3. Verify signature
|
||||
let pk_hash = match self.dict.get(&hash_str(KEY_SIGNER).into()) {
|
||||
Ok(v) => v,
|
||||
Err(_) => return false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue