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

fix : refactored ptau file for test into hardcoded data #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
Binary file removed ptau/ppot_0080_01.ptau.test
Binary file not shown.
18 changes: 11 additions & 7 deletions src/kzg/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,7 @@ mod tests {
use ark_bn254::Bn254;
use ark_ff::{BigInt, BigInteger, PrimeField};

pub const TEST_PTAU_FILEPATH: &str = "ptau/ppot_0080_01.ptau.test";
pub const TEST_FILE_LEN: usize = 95_634;


pub const TEST_CEREMONY_POWER: u32 = 28;
pub const TEST_FILE_POWER: u32 = 1;
Expand All @@ -405,16 +404,20 @@ mod tests {

#[test]
fn test_file_loader() {
let loader = FileLoader::new(PathBuf::from(TEST_PTAU_FILEPATH));
let file_data = loader.load().expect("Failed to load the test ptau file");
// Hardcoded byte string for testing
let file_data: Vec<u8> = vec![

];

assert_eq!(file_data.len(), TEST_FILE_LEN);
assert_eq!(file_data.len(), TEST_FILE_LEN); // Update this line if necessary
}

#[test]
fn test_verify_metadata() {
let loader = FileLoader::new(PathBuf::from(TEST_PTAU_FILEPATH));
let file_data = loader.load().expect("Failed to load the test ptau file");
// Hardcoded byte string for testing
let file_data: Vec<u8> = vec![
// Add the byte strings for the metadata and sections here
];

assert_eq!(verify_metadata(&file_data), Ok(()));
}
Expand Down Expand Up @@ -519,3 +522,4 @@ mod tests {
assert_eq!(g2_pow.len(), 2u32.pow(TEST_FILE_POWER) as usize);
}
}