Skip to content

Commit

Permalink
StarkProof::new_dummy()
Browse files Browse the repository at this point in the history
  • Loading branch information
plafer committed Nov 30, 2023
1 parent cd92409 commit 03b99ee
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
29 changes: 29 additions & 0 deletions air/src/proof/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,35 @@ impl StarkProof {
}
Ok(proof)
}

/// Creates a dummy `StarkProof` for use in tests
pub fn new_dummy() -> Self {
use crate::FieldExtension;
use crypto::hashers::Blake3_192 as DummyHasher;
use crypto::BatchMerkleProof;
use math::fields::f64::BaseElement as DummyField;

Self {
context: Context::new::<DummyField>(
&TraceInfo::new(0, 0),
ProofOptions::new(0, 0, 0, FieldExtension::None, 0, 0),
),
num_unique_queries: 0,
commitments: Commitments::default(),
trace_queries: Vec::new(),
constraint_queries: Queries::new::<_, DummyField>(
BatchMerkleProof::<DummyHasher<DummyField>> {
leaves: Vec::new(),
nodes: Vec::new(),
depth: 0,
},
Vec::new(),
),
ood_frame: OodFrame::default(),
fri_proof: FriProof::new_dummy(),
pow_nonce: 0,
}
}
}

// HELPER FUNCTIONS
Expand Down
9 changes: 9 additions & 0 deletions fri/src/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ impl FriProof {
}
}

/// Creates a dummy `FriProof` for use in tests
pub fn new_dummy() -> Self {
Self {
layers: Vec::new(),
remainder: Vec::new(),
num_partitions: 0,
}
}

// PUBLIC ACCESSORS
// --------------------------------------------------------------------------------------------

Expand Down

0 comments on commit 03b99ee

Please sign in to comment.