diff --git a/folding-schemes/src/commitment/ipa.rs b/folding-schemes/src/commitment/ipa.rs index 66b8bef1..a06949eb 100644 --- a/folding-schemes/src/commitment/ipa.rs +++ b/folding-schemes/src/commitment/ipa.rs @@ -684,8 +684,13 @@ mod tests { let proofVar = ProofVar::::new_witness(cs.clone(), || Ok(proof.0))?; let r_blindVar = EmulatedFpVar::::new_witness(cs.clone(), || Ok(r_blind))?; let uVar_vec = Vec::>::new_witness(cs.clone(), || Ok(u))?; - let uVar: [EmulatedFpVar; k] = - uVar_vec.try_into().map_err(|_| Error::TypeConversion)?; + let uVar: [EmulatedFpVar; k] = uVar_vec.try_into().map_err(|_| { + Error::ConversionError( + "Vec<_>".to_string(), + "[_; 1]".to_string(), + "variable name: uVar".to_string(), + ) + })?; let UVar = GVar::new_witness(cs.clone(), || Ok(U))?; let v = IPAGadget::::verify::( diff --git a/folding-schemes/src/folding/protogalaxy/decider_eth.rs b/folding-schemes/src/folding/protogalaxy/decider_eth.rs index a1730656..08579f9d 100644 --- a/folding-schemes/src/folding/protogalaxy/decider_eth.rs +++ b/folding-schemes/src/folding/protogalaxy/decider_eth.rs @@ -174,10 +174,20 @@ where Ok(Self::Proof { snark_proof, L_X_evals, - kzg_proofs: kzg_proofs.try_into().map_err(|_| Error::TypeConversion)?, - kzg_challenges: kzg_challenges - .try_into() - .map_err(|_| Error::TypeConversion)?, + kzg_proofs: kzg_proofs.try_into().map_err(|_| { + Error::ConversionError( + "Vec<_>".to_string(), + "[_; 1]".to_string(), + "variable name: kzg_proofs".to_string(), + ) + })?, + kzg_challenges: kzg_challenges.try_into().map_err(|_| { + Error::ConversionError( + "Vec<_>".to_string(), + "[_; 1]".to_string(), + "variable name: kzg_challenges".to_string(), + ) + })?, }) } diff --git a/folding-schemes/src/lib.rs b/folding-schemes/src/lib.rs index 59fe3085..2db8f711 100644 --- a/folding-schemes/src/lib.rs +++ b/folding-schemes/src/lib.rs @@ -122,8 +122,6 @@ pub enum Error { NoMultiInstances, #[error("Missing 'other' instances, since this is a multi-instances folding scheme. Expected number of instances, mu:{0}, nu:{1}")] MissingOtherInstances(usize, usize), - #[error("Type conversion error")] - TypeConversion, } /// FoldingScheme defines trait that is implemented by the diverse folding schemes. It is defined diff --git a/folding-schemes/src/transcript/poseidon.rs b/folding-schemes/src/transcript/poseidon.rs index 9377f0f8..595568a7 100644 --- a/folding-schemes/src/transcript/poseidon.rs +++ b/folding-schemes/src/transcript/poseidon.rs @@ -135,7 +135,11 @@ pub mod tests { let mut poseidon_sponge: PoseidonSponge<_> = CryptographicSponge::new(&config); let v: Vec = vec!["1", "2", "3", "4"] .into_iter() - .map(|x| Fr::from_str(x).map_err(|_| Error::TypeConversion)) + .map(|x| { + Fr::from_str(x).map_err(|_| { + Error::ConversionError("str".to_string(), "Fr".to_string(), x.to_string()) + }) + }) .collect::, Error>>()?; poseidon_sponge.absorb(&v); poseidon_sponge.squeeze_field_elements::(1); @@ -144,7 +148,7 @@ pub mod tests { == Fr::from_str( "18821383157269793795438455681495246036402687001665670618754263018637548127333" ) - .map_err(|_| Error::TypeConversion)? + .unwrap() ); Ok(()) }