Padding in set target (#200)

* feat: handle padding in set_target

* remove enable from MerkleClaimAndProof

* Update src/backends/plonky2/circuits/mainpod.rs

Co-authored-by: Ahmad Afuni <root@ahmadafuni.com>

---------

Co-authored-by: Ahmad Afuni <root@ahmadafuni.com>
This commit is contained in:
Eduard S. 2025-04-21 17:27:29 +02:00 committed by GitHub
parent 17e6c2a092
commit 26a6b2d143
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 87 additions and 143 deletions

View file

@ -74,16 +74,15 @@ impl Operation {
})
.collect::<Result<Vec<_>>>()?;
let deref_aux = match self.2 {
OperationAux::None => Ok(crate::middleware::OperationAux::None),
OperationAux::MerkleProofIndex(i) => merkle_proofs
.get(i)
.cloned()
.ok_or(anyhow!("Missing Merkle proof index {}", i))
.and_then(|mp| {
mp.try_into()
.map(crate::middleware::OperationAux::MerkleProof)
}),
}?;
OperationAux::None => crate::middleware::OperationAux::None,
OperationAux::MerkleProofIndex(i) => crate::middleware::OperationAux::MerkleProof(
merkle_proofs
.get(i)
.ok_or(anyhow!("Missing Merkle proof index {}", i))?
.proof
.clone(),
),
};
middleware::Operation::op(self.0.clone(), &deref_args, &deref_aux)
}
}