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:
Eduard S. 2025-05-16 13:17:14 +02:00 committed by GitHub
parent f5a1aa7523
commit def0730462
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 629 additions and 153 deletions

View file

@ -274,12 +274,12 @@ mod tests {
params.print_serialized_sizes();
// ETH friend custom predicate batch
let eth_friend = eth_friend_batch(&params)?;
let eth_friend = eth_friend_batch(&params, true)?;
// This batch only has 1 predicate, so we pick it already for convenience
let eth_friend = Predicate::Custom(CustomPredicateRef::new(eth_friend, 0));
let eth_dos_batch = eth_dos_batch(&params)?;
let eth_dos_batch = eth_dos_batch(&params, true)?;
let eth_dos_batch_mw: middleware::CustomPredicateBatch =
Arc::unwrap_or_clone(eth_dos_batch);
let fields = eth_dos_batch_mw.to_fields(&params);