Fix custom predicate circuits and add tests for them (#235)
* add tests, fix custom predicates * wip * wip * fix custom predicates * modularize code * fix typos * remove scratch file * update * 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:
parent
f5a1aa7523
commit
def0730462
16 changed files with 629 additions and 153 deletions
|
|
@ -69,10 +69,7 @@ pub fn zu_kyc_pod_builder(
|
|||
|
||||
// ETHDoS
|
||||
|
||||
pub fn eth_friend_signed_pod_builder(
|
||||
params: &Params,
|
||||
friend_pubkey: TypedValue,
|
||||
) -> SignedPodBuilder {
|
||||
pub fn eth_friend_signed_pod_builder(params: &Params, friend_pubkey: Value) -> SignedPodBuilder {
|
||||
let mut attestation = SignedPodBuilder::new(params);
|
||||
attestation.insert("attestation", friend_pubkey);
|
||||
|
||||
|
|
@ -81,13 +78,14 @@ pub fn eth_friend_signed_pod_builder(
|
|||
|
||||
pub fn eth_dos_pod_builder(
|
||||
params: &Params,
|
||||
mock: bool,
|
||||
alice_attestation: &SignedPod,
|
||||
charlie_attestation: &SignedPod,
|
||||
bob_pubkey: &TypedValue,
|
||||
bob_pubkey: Value,
|
||||
) -> Result<MainPodBuilder> {
|
||||
// Will need ETH friend and ETH DoS custom predicate batches.
|
||||
let eth_friend = CustomPredicateRef::new(eth_friend_batch(params)?, 0);
|
||||
let eth_dos_batch = eth_dos_batch(params)?;
|
||||
let eth_friend = CustomPredicateRef::new(eth_friend_batch(params, mock)?, 0);
|
||||
let eth_dos_batch = eth_dos_batch(params, mock)?;
|
||||
let eth_dos_base = CustomPredicateRef::new(eth_dos_batch.clone(), 0);
|
||||
let eth_dos_ind = CustomPredicateRef::new(eth_dos_batch.clone(), 1);
|
||||
let eth_dos = CustomPredicateRef::new(eth_dos_batch.clone(), 2);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue