Skip to content

Commit

Permalink
Merge branch 'mainnet-staging' into mitigate-free-verification
Browse files Browse the repository at this point in the history
  • Loading branch information
raychu86 authored Apr 12, 2024
2 parents 69f9100 + d48f6fb commit dcc3018
Show file tree
Hide file tree
Showing 75 changed files with 2,041 additions and 39 deletions.
12 changes: 11 additions & 1 deletion circuit/environment/src/helpers/converter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use crate::{Circuit, LinearCombination, Variable, R1CS};
use crate::{Circuit, LinearCombination, TestnetCircuit, Variable, R1CS};
use snarkvm_curves::edwards_bls12::Fq;
use snarkvm_fields::PrimeField;

Expand All @@ -34,6 +34,16 @@ impl snarkvm_algorithms::r1cs::ConstraintSynthesizer<Fq> for Circuit {
}
}

impl snarkvm_algorithms::r1cs::ConstraintSynthesizer<Fq> for TestnetCircuit {
/// Synthesizes the constraints from the environment into a `snarkvm_algorithms::r1cs`-compliant constraint system.
fn generate_constraints<CS: snarkvm_algorithms::r1cs::ConstraintSystem<Fq>>(
&self,
cs: &mut CS,
) -> Result<(), snarkvm_algorithms::r1cs::SynthesisError> {
crate::testnet_circuit::TESTNET_CIRCUIT.with(|circuit| circuit.borrow().generate_constraints(cs))
}
}

impl<F: PrimeField> R1CS<F> {
/// Synthesizes the constraints from the environment into a `snarkvm_algorithms::r1cs`-compliant constraint system.
fn generate_constraints<CS: snarkvm_algorithms::r1cs::ConstraintSystem<F>>(
Expand Down
3 changes: 3 additions & 0 deletions circuit/environment/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ pub mod macros;
#[allow(unused_imports)]
pub use macros::*;

pub mod testnet_circuit;
pub use testnet_circuit::*;

pub mod traits;
pub use traits::*;

Expand Down
Loading

0 comments on commit dcc3018

Please sign in to comment.