From b6125d2093abb645827e8ef279896f8f6998053b Mon Sep 17 00:00:00 2001 From: Alex Vlasov Date: Wed, 17 Jun 2020 22:11:24 +0300 Subject: [PATCH] fix cs error too --- Cargo.toml | 6 ++---- src/cs.rs | 12 +++++++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1bea73a86..2439cde07 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ homepage = "https://github.com/matter-labs/bellman" license = "MIT/Apache-2.0" name = "bellman_ce" repository = "https://github.com/matter-labs/bellman" -version = "0.3.4" +version = "0.3.5" edition = "2018" [lib] @@ -17,8 +17,7 @@ rand = "0.4" bit-vec = "0.6" cfg-if = "0.1" -#pairing = {package = "pairing_ce", path = "../pairing" } -pairing = {package = "pairing_ce", version = "0.21" } +pairing = {package = "pairing_ce", version = "0.21.*" } byteorder = "1" futures= {package = "futures", version = "0.3", default_features = false, features = ["executor"]} @@ -35,7 +34,6 @@ blake2-rfc = {version = "0.2.18", optional = true} [features] # default = [] default = ["multicore"] -#default = ["wasm"] multicore = ["crossbeam", "futures/thread-pool"] sonic = ["tiny-keccak", "blake2-rfc"] gm17 = [] diff --git a/src/cs.rs b/src/cs.rs index b1395fa39..17a58b936 100644 --- a/src/cs.rs +++ b/src/cs.rs @@ -178,8 +178,8 @@ impl From for SynthesisError { } } -impl Error for SynthesisError { - fn description(&self) -> &str { +impl SynthesisError { + pub fn self_description(&self) -> &str { match *self { SynthesisError::AssignmentMissing => "an assignment for a variable could not be computed", SynthesisError::DivisionByZero => "division by zero", @@ -193,13 +193,19 @@ impl Error for SynthesisError { } } +impl Error for SynthesisError { + fn description(&self) -> &str { + self.self_description() + } +} + impl fmt::Display for SynthesisError { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { if let &SynthesisError::IoError(ref e) = self { write!(f, "I/O error: ")?; e.fmt(f) } else { - write!(f, "{}", self.to_string()) + write!(f, "{}", self.self_description()) } } }