Skip to content

Commit

Permalink
Fix process_block script
Browse files Browse the repository at this point in the history
  • Loading branch information
fmkra committed Mar 22, 2024
1 parent 207a388 commit cce7a73
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
20 changes: 10 additions & 10 deletions src/lib.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ use cairo_verifier::{
// === DEX END ===
// === RECURSIVE BEGIN ===
air::layouts::recursive::public_input::RecursivePublicInputImpl as PublicInputImpl,
// === RECURSIVE END ===
// === RECURSIVE_WITH_POSEIDON BEGIN ===
// air::layouts::recursive_with_poseidon::public_input::RecursiveWithPoseidonPublicInputImpl as PublicInputImpl,
// === RECURSIVE_WITH_POSEIDON END ===
// === SMALL BEGIN ===
// air::layouts::small::public_input::SmallPublicInputImpl as PublicInputImpl,
// === SMALL END ===
// === STARKNET BEGIN ===
// air::layouts::starknet::public_input::StarknetPublicInputImpl as PublicInputImpl,
// === STARKNET END ===
// === RECURSIVE END ===
// === RECURSIVE_WITH_POSEIDON BEGIN ===
// air::layouts::recursive_with_poseidon::public_input::RecursiveWithPoseidonPublicInputImpl as PublicInputImpl,
// === RECURSIVE_WITH_POSEIDON END ===
// === SMALL BEGIN ===
// air::layouts::small::public_input::SmallPublicInputImpl as PublicInputImpl,
// === SMALL END ===
// === STARKNET BEGIN ===
// air::layouts::starknet::public_input::StarknetPublicInputImpl as PublicInputImpl,
// === STARKNET END ===
};

const SECURITY_BITS: felt252 = 50;
Expand Down
2 changes: 1 addition & 1 deletion src/stark/tests/test_stark_proof_verify.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use cairo_verifier::{
// #[available_gas(99999999999)]
// fn test_stark_proof_fibonacci_verify() {
// let security_bits: felt252 = 50;
//
//
// let stark_proof = StarkProof {
// config: stone_proof_fibonacci::stark::config::get(),
// public_input: stone_proof_fibonacci::public_input::get(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use cairo_verifier::{
// let queries = stone_proof_fibonacci::queries::get().span();
// let decommitment = stone_proof_fibonacci::traces::decommitment::get().original;
// let witness = stone_proof_fibonacci::traces::witness::get().original;
//
//
// table_decommit(commitment, queries, decommitment, witness);
// }
// === BLAKE2S END ===
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use cairo_verifier::vector_commitment::vector_commitment::{
// },
// commitment_hash: 0x1e9b0fa29ebe52b9c9a43a1d44e555ce42da3199370134d758735bfe9f40269
// };
//
//
// let queries = array![
// VectorQuery {
// index: 0x73, value: 0x12346ea425a6aebc8c323a401410cc325aabaf99b54e600a7271f146488aa2d
Expand Down Expand Up @@ -47,7 +47,7 @@ use cairo_verifier::vector_commitment::vector_commitment::{
// },
// ]
// .span();
//
// //
// let witness = VectorCommitmentWitness {
// authentications: array![
// 0x2e9de49846b184d454c30e3b4854167583093da20c5ddef5e3ba2885524d006,
Expand Down Expand Up @@ -103,7 +103,7 @@ use cairo_verifier::vector_commitment::vector_commitment::{
// ]
// .span(),
// };
//
// //
// vector_commitment_decommit(commitment, queries, witness);
// }
// === BLAKE2S END ===
Expand Down
8 changes: 6 additions & 2 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,19 @@ def process_block(lines: list[str], types: list[str]):
modified_lines.append(line)
continue

if in_block and line.strip() != "":
if in_block:
if current_block_type in types:
# Remove comment if exists
if line.lstrip().startswith("// "):
modified_lines.append(indent + line.lstrip()[3:])
else:
modified_lines.append(line)
else:
# Add comment if does not exist
if not line.lstrip().startswith("// "):
modified_lines.append(indent + "// " + line.lstrip())
line_indent = len(line) - len(line.lstrip())
subtracted_indent = min(len(indent), line_indent)
modified_lines.append(indent + "// " + line[subtracted_indent:])
else:
modified_lines.append(line)
else:
Expand Down

0 comments on commit cce7a73

Please sign in to comment.