소스 검색

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