diff --git a/leo/commands/build.rs b/leo/commands/build.rs index 79f7925297..7bb6df7693 100644 --- a/leo/commands/build.rs +++ b/leo/commands/build.rs @@ -164,10 +164,9 @@ impl CLI for BuildCommand { use num_bigint::BigUint; use serde::{Deserialize, Serialize}; -use snarkos_curves::bls12_377::Fr; use snarkos_errors::curves::FieldError; -use snarkos_models::curves::{Field, Fp256, Fp256Parameters, PrimeField}; -use std::{convert::TryInto, str::FromStr}; +use snarkos_models::curves::{Field, Fp256, Fp256Parameters}; +use std::str::FromStr; #[derive(Serialize, Deserialize)] pub struct SerializedKeypairAssembly { @@ -242,11 +241,11 @@ impl TryFrom for KeypairAssembly { fn try_from(serialized: SerializedKeypairAssembly) -> Result, Self::Error> { fn get_deserialized_constraints( constraints: &Vec<(SerializedField, SerializedIndex)>, - ) -> Result, FieldError> { + ) -> Result::Fr, Index)>, FieldError> { let mut deserialized = vec![]; for &(ref serialized_coeff, ref serialized_index) in constraints.iter() { - let field = Fr::try_from(serialized_coeff)?; + let field = ::Fr::try_from(serialized_coeff)?; let index = Index::from(serialized_index); deserialized.push((field, index)); @@ -306,11 +305,11 @@ impl From<&F> for SerializedField { } } -impl TryFrom<&SerializedField> for Fr { +impl TryFrom<&SerializedField> for Fp256

{ type Error = FieldError; fn try_from(serialized: &SerializedField) -> Result { - Ok(Fr::from_str(&serialized.0).unwrap()) + Fp256::

::from_str(&serialized.0) } }