Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement StarkProof::new_dummy() #232

Merged
merged 2 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
irakliyk marked this conversation as resolved.
Show resolved Hide resolved
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
irakliyk marked this conversation as resolved.
Show resolved Hide resolved
pub fn new_dummy() -> Self {
Self {
layers: Vec::new(),
remainder: Vec::new(),
num_partitions: 0,
}
}

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

Expand Down
Loading