Skip to content

Commit 8114923

Browse files
committed
Expose generate_{tx,merge,block,zkapp}_proof as public methods
1 parent f0aa0d0 commit 8114923

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

ledger/src/proofs/block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1743,7 +1743,7 @@ pub struct BlockParams<'a> {
17431743

17441744
const BLOCK_N_PREVIOUS_PROOFS: usize = 2;
17451745

1746-
pub fn generate_block_proof(params: BlockParams, w: &mut Witness<Fp>) -> WrapProof {
1746+
pub(super) fn generate_block_proof(params: BlockParams, w: &mut Witness<Fp>) -> WrapProof {
17471747
w.ocaml_aux = read_witnesses();
17481748

17491749
let BlockParams {

ledger/src/proofs/merge.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ pub struct MergeParams<'a> {
167167

168168
const MERGE_N_PREVIOUS_PROOFS: usize = 2;
169169

170-
pub fn generate_merge_proof(params: MergeParams, w: &mut Witness<Fp>) -> WrapProof {
170+
pub(super) fn generate_merge_proof(params: MergeParams, w: &mut Witness<Fp>) -> WrapProof {
171171
let MergeParams {
172172
statement,
173173
proofs,

ledger/src/proofs/mod.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,20 @@ pub mod zkapp;
2424

2525
pub const BACKEND_TICK_ROUNDS_N: usize = 16;
2626
pub const BACKEND_TOCK_ROUNDS_N: usize = 15;
27+
28+
pub fn generate_tx_proof(params: transaction::TransactionParams) -> wrap::WrapProof {
29+
use {mina_hasher::Fp, witness::Witness};
30+
let mut w: Witness<Fp> = Witness::new::<constants::StepTransactionProof>();
31+
transaction::generate_tx_proof(params, &mut w)
32+
}
33+
pub fn generate_merge_proof(params: merge::MergeParams) -> wrap::WrapProof {
34+
use {mina_hasher::Fp, witness::Witness};
35+
let mut w: Witness<Fp> = Witness::new::<constants::StepMergeProof>();
36+
merge::generate_merge_proof(params, &mut w)
37+
}
38+
pub fn generate_block_proof(params: block::BlockParams) -> wrap::WrapProof {
39+
use {mina_hasher::Fp, witness::Witness};
40+
let mut w: Witness<Fp> = Witness::new::<constants::StepBlockProof>();
41+
block::generate_block_proof(params, &mut w)
42+
}
43+
pub use zkapp::generate_zkapp_proof;

ledger/src/proofs/transaction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3928,7 +3928,7 @@ pub struct TransactionParams<'a> {
39283928
pub ocaml_wrap_witness: Option<Vec<Fq>>,
39293929
}
39303930

3931-
fn generate_tx_proof(params: TransactionParams, w: &mut Witness<Fp>) -> WrapProof {
3931+
pub(super) fn generate_tx_proof(params: TransactionParams, w: &mut Witness<Fp>) -> WrapProof {
39323932
let TransactionParams {
39333933
statement,
39343934
tx_witness,

0 commit comments

Comments
 (0)