Browse Source

Only emit the protocol_witness function if emit_prover is set

Ian Goldberg 4 months ago
parent
commit
82058d6cda
1 changed files with 3 additions and 1 deletions
  1. 3 1
      sigma_compiler_core/src/sigma/codegen.rs

+ 3 - 1
sigma_compiler_core/src/sigma/codegen.rs

@@ -618,7 +618,7 @@ impl<'a> CodeGen<'a> {
         };
 
         // Generate the function that creates the sigma-rs ProtocolWitness
-        let witness_func = {
+        let witness_func = if emit_prover {
             quote! {
                 fn protocol_witness(
                     params: &Params,
@@ -627,6 +627,8 @@ impl<'a> CodeGen<'a> {
                     #witness_code
                 }
             }
+        } else {
+            quote! {}
         };
 
         // Generate the prove function