From 352b1fdac1bdb476a8afa48e7fa3d70075ae563a Mon Sep 17 00:00:00 2001 From: "Eduard S." Date: Fri, 26 Sep 2025 12:47:00 +0200 Subject: [PATCH] Allow creation of opaque custom predicate batch (#427) This is useful for a verifier that wants to verify a MainPod that contains a custom predicate in a public statement without knowledge of how the custom predicate is defined. --- src/middleware/custom.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/middleware/custom.rs b/src/middleware/custom.rs index 306e464..642284b 100644 --- a/src/middleware/custom.rs +++ b/src/middleware/custom.rs @@ -404,6 +404,14 @@ impl CustomPredicateBatch { Arc::new(cpb) } + pub fn new_opaque(name: String, id: Hash) -> Arc { + Arc::new(Self { + id, + name, + predicates: vec![], + }) + } + /// Cryptographic identifier for the batch. fn calculate_id(&self, params: &Params) -> Hash { // NOTE: This implementation just hashes the concatenation of all the custom predicates,