浏览代码

Only emit the protocol_witness function if emit_prover is set

Ian Goldberg 7 月之前
父节点
当前提交
82058d6cda
共有 1 个文件被更改,包括 3 次插入1 次删除
  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