Skip to content

Commit

Permalink
feat: add context to mock mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ratankaliani committed Jan 10, 2025
1 parent fd6609b commit 8f8eb34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions crates/sdk/src/cpu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl CpuProver {

// If we're in mock mode, return a mock proof.
if self.mock {
return self.mock_prove_impl(pk, stdin, mode);
return self.mock_prove_impl(pk, stdin, context, mode);
}

// Generate the core proof.
Expand Down Expand Up @@ -186,13 +186,13 @@ impl CpuProver {
}
}

pub(crate) fn mock_prove_impl(
&self,
pub(crate) fn mock_prove_impl<'a>(
&'a self,
pk: &SP1ProvingKey,
stdin: &SP1Stdin,
context: SP1Context<'a>,
mode: SP1ProofMode,
) -> Result<SP1ProofWithPublicValues> {
let context = SP1Context::default();
let (public_values, _) = self.prover.execute(&pk.elf, stdin, context)?;
Ok(SP1ProofWithPublicValues::create_mock_proof(pk, public_values, mode, self.version()))
}
Expand Down
2 changes: 1 addition & 1 deletion crates/sdk/src/cpu/prove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ impl<'a> CpuProveBuilder<'a> {

// Run the prover.
if mock {
prover.mock_prove_impl(pk, &stdin, mode)
prover.mock_prove_impl(pk, &stdin, context, mode)
} else {
prover.prove_impl(pk, &stdin, opts, context, mode)
}
Expand Down

0 comments on commit 8f8eb34

Please sign in to comment.