prove_transaction_case

Function prove_transaction_case 

Source
pub fn prove_transaction_case(
    wasm: &PathBuf,
    r1cs: &PathBuf,
    case: &TxCase,
    leaves: Vec<FpBN256>,
    public_amount: FpBN256,
    expected_levels: usize,
) -> Result<()>
Expand description

Runs a Circom proof/verify cycle for a transaction test case

Prepares the transaction witness, builds circuit inputs, and executes a proof generation and verification cycle.

§Arguments

  • wasm - Path to the compiled WASM file
  • r1cs - Path to the R1CS constraint system file
  • case - Transaction case to prove
  • leaves - Initial leaves vector for the Merkle tree
  • public_amount - Public amount scalar value
  • expected_levels - Expected number of levels in the Merkle tree

§Returns

Returns Ok(()) if the proof is generated and verified successfully, or an error if witness preparation, proving, or verification fails.