Skip to content

Commit d0b0837

Browse files
committed
remove _prove functions
1 parent d8aa33e commit d0b0837

File tree

4 files changed

+13
-19
lines changed

4 files changed

+13
-19
lines changed

src/backends/plonky2/emptypod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static EMPTY_POD_CACHE: LazyLock<Mutex<HashMap<Hash, EmptyPod>>> =
106106
LazyLock::new(|| Mutex::new(HashMap::new()));
107107

108108
impl EmptyPod {
109-
pub fn _prove(params: &Params, vd_set: VDSet) -> Result<EmptyPod> {
109+
pub fn new(params: &Params, vd_set: VDSet) -> Result<EmptyPod> {
110110
let (empty_pod_verify_target, data) = &*STANDARD_EMPTY_POD_DATA;
111111

112112
let mut pw = PartialWitness::<F>::new();
@@ -129,7 +129,7 @@ impl EmptyPod {
129129
.lock()
130130
.unwrap()
131131
.entry(vd_set.root())
132-
.or_insert_with(|| Self::_prove(params, vd_set).expect("prove EmptyPod"))
132+
.or_insert_with(|| Self::new(params, vd_set).expect("prove EmptyPod"))
133133
.clone();
134134
Box::new(empty_pod)
135135
}

src/backends/plonky2/mainpod/mod.rs

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,13 @@ pub(crate) fn process_public_statements_operations(
431431

432432
pub struct Prover {}
433433

434-
impl Prover {
435-
fn _prove(&self, params: &Params, vd_set: &VDSet, inputs: MainPodInputs) -> Result<MainPod> {
434+
impl PodProver for Prover {
435+
fn prove(
436+
&self,
437+
params: &Params,
438+
vd_set: &VDSet,
439+
inputs: MainPodInputs,
440+
) -> Result<Box<dyn RecursivePod>> {
436441
let rec_circuit_data = &*STANDARD_REC_MAIN_POD_CIRCUIT_DATA;
437442
let (main_pod_target, circuit_data) =
438443
RecursiveCircuit::<MainPodVerifyTarget>::target_and_circuit_data_padded(
@@ -542,24 +547,13 @@ impl Prover {
542547
};
543548
let proof_with_pis = main_pod.prove(&input, proofs, verifier_datas)?;
544549

545-
Ok(MainPod {
550+
Ok(Box::new(MainPod {
546551
params: params.clone(),
547552
id,
548553
vd_set: inputs.vds_set,
549554
public_statements,
550555
proof: proof_with_pis.proof,
551-
})
552-
}
553-
}
554-
555-
impl PodProver for Prover {
556-
fn prove(
557-
&self,
558-
params: &Params,
559-
vd_set: &VDSet,
560-
inputs: MainPodInputs,
561-
) -> Result<Box<dyn RecursivePod>> {
562-
Ok(self._prove(params, vd_set, inputs).map(Box::new)?)
556+
}))
563557
}
564558
}
565559

src/backends/plonky2/mock/signedpod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ pub mod tests {
186186
.downcast::<MockSignedPod>()
187187
.unwrap();
188188

189-
pod._verify()?;
189+
pod.verify()?;
190190
println!("id: {}", pod.id());
191191
println!("kvs: {:?}", pod.kvs());
192192

src/backends/plonky2/signedpod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ pub mod tests {
225225
let pod = pod.sign(&mut signer).unwrap();
226226
let pod = (pod.pod as Box<dyn Any>).downcast::<SignedPod>().unwrap();
227227

228-
pod._verify()?;
228+
pod.verify()?;
229229
println!("id: {}", pod.id());
230230
println!("kvs: {:?}", pod.kvs());
231231

0 commit comments

Comments
 (0)