Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Commit 05ccd49

Browse files
committed
Public input printing added #47
1 parent 2f404a5 commit 05ccd49

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

test/placeholder_proof.cpp

+18-2
Original file line numberDiff line numberDiff line change
@@ -468,12 +468,28 @@ BOOST_FIXTURE_TEST_CASE(proof_marshalling_test, test_initializer){
468468
}else {
469469
test_placeholder_proof<Endianness, placeholder_proof<field_type, lpc_placeholder_params_type>>(lpc_proof);
470470
}
471-
/*
471+
472+
std::size_t max_non_zero = 0;
473+
for(std::size_t i = 0; i < assignments.public_input(0).size(); i++){
474+
if( assignments.public_input(0)[i] != 0 ){
475+
max_non_zero = i;
476+
}
477+
}
478+
479+
std::ofstream pi_stream;
480+
pi_stream.open("circuit2/input.json");
481+
pi_stream << "[" << std::endl;
482+
for(std::size_t i = 0; i <= max_non_zero; i++ ){
483+
if( i != 0 ) pi_stream << "," << std::endl;
484+
pi_stream << "\t{\"field\": "<< assignments.public_input(0)[i] << " }";
485+
}
486+
pi_stream << std::endl << "]";
487+
pi_stream.close();
488+
472489
verifier_res = placeholder_verifier<field_type, lpc_placeholder_params_type>::process(
473490
lpc_preprocessed_public_data, lpc_proof, constraint_system, lpc_scheme
474491
);
475492
BOOST_CHECK(verifier_res);
476-
*/
477493
}
478494
BOOST_AUTO_TEST_SUITE_END()
479495

0 commit comments

Comments
 (0)