diff --git a/integration-tests/src/integration_test_circuits.rs b/integration-tests/src/integration_test_circuits.rs index 4771edd86e..c9bfd37a09 100644 --- a/integration-tests/src/integration_test_circuits.rs +++ b/integration-tests/src/integration_test_circuits.rs @@ -7,7 +7,10 @@ use eth_types::geth_types::GethData; use halo2_proofs::{ dev::{CellValue, MockProver}, halo2curves::bn256::{Bn256, Fr, G1Affine}, - plonk::{create_proof, keygen_pk, keygen_vk, verify_proof, Circuit, ProvingKey, VerifyingKey}, + plonk::{ + create_proof, keygen_pk, keygen_vk, permutation::Assembly, verify_proof, Circuit, + ProvingKey, VerifyingKey, + }, poly::{ commitment::ParamsProver, kzg::{ @@ -139,6 +142,7 @@ pub struct IntegrationTest + Circuit> { degree: u32, key: Option>, fixed: Option>>>, + permutation: Option, _marker: PhantomData, } @@ -149,6 +153,7 @@ impl + Circuit> IntegrationTest { degree, key: None, fixed: None, + permutation: None, _marker: PhantomData, } } @@ -266,20 +271,25 @@ impl + Circuit> IntegrationTest { fn test_variadic(&mut self, mock_prover: &MockProver) { let fixed = mock_prover.fixed(); - match self.fixed.clone() { - Some(prev_fixed) => { - assert!( - fixed.eq(&prev_fixed), - "circuit fixed columns are not constant for different witnesses" - ); - } - None => { - self.fixed = Some(fixed.clone()); - } - }; + if let Some(prev_fixed) = self.fixed.clone() { + assert!( + fixed.eq(&prev_fixed), + "circuit fixed columns are not constant for different witnesses" + ); + } else { + self.fixed = Some(fixed.clone()); + } + + let permutation = mock_prover.permutation(); - // TODO: check mock_prover.permutation(), currently the returning type - // is private so cannot store. + if let Some(prev_permutation) = self.permutation.clone() { + assert!( + permutation.eq(&prev_permutation), + "circuit permutations are not constant for different witnesses" + ); + } else { + self.permutation = Some(permutation.clone()); + } } /// Run integration test at a block identified by a tag.