diff --git a/indy-credx/src/error.rs b/indy-credx/src/error.rs index 25b976b..059e2c9 100644 --- a/indy-credx/src/error.rs +++ b/indy-credx/src/error.rs @@ -137,7 +137,6 @@ impl From for Error { impl From for Error { fn from(err: ClError) -> Self { - // let message = format!("Ursa Crypto Error: {}", Fail::iter_causes(&err).map(|e| e.to_string()).collect::()); let message = err.to_string(); let kind = match err.kind() { ClErrorKind::InvalidState => ErrorKind::InvalidState, diff --git a/indy-data-types/src/anoncreds/nonce.rs b/indy-data-types/src/anoncreds/nonce.rs index f215605..fc3d3d1 100644 --- a/indy-data-types/src/anoncreds/nonce.rs +++ b/indy-data-types/src/anoncreds/nonce.rs @@ -6,13 +6,13 @@ use std::hash::{Hash, Hasher}; use serde::{de::Visitor, Deserialize, Deserializer, Serialize, Serializer}; #[cfg(any(feature = "cl", feature = "cl_native"))] -use crate::anoncreds_clsignatures::{new_nonce, Nonce as UrsaNonce}; +use crate::anoncreds_clsignatures::{new_nonce, Nonce as ClNonce}; use crate::ConversionError; pub struct Nonce { strval: String, #[cfg(any(feature = "cl", feature = "cl_native"))] - native: UrsaNonce, + native: ClNonce, } impl Nonce { @@ -26,20 +26,20 @@ impl Nonce { #[cfg(any(feature = "cl", feature = "cl_native"))] #[inline] - pub fn from_native(native: UrsaNonce) -> Result { + pub fn from_native(native: ClNonce) -> Result { let strval = native.to_dec().map_err(|e| e.to_string())?; Ok(Self { strval, native }) } #[cfg(any(feature = "cl", feature = "cl_native"))] #[inline] - pub fn as_native(&self) -> &UrsaNonce { + pub fn as_native(&self) -> &ClNonce { &self.native } #[cfg(any(feature = "cl", feature = "cl_native"))] #[inline] - pub fn into_native(self) -> UrsaNonce { + pub fn into_native(self) -> ClNonce { self.native } @@ -55,7 +55,7 @@ impl Nonce { } #[cfg(any(feature = "cl", feature = "cl_native"))] { - let native = UrsaNonce::from_dec(&strval).map_err(|e| e.to_string())?; + let native = ClNonce::from_dec(&strval).map_err(|e| e.to_string())?; Ok(Self { strval, native }) } #[cfg(not(any(feature = "cl", feature = "cl_native")))] @@ -243,11 +243,11 @@ mod tests { #[cfg(all(feature = "serde", any(feature = "cl", feature = "cl_native")))] #[test] fn nonce_convert() { - let nonce = UrsaNonce::new().expect("Error creating nonce"); + let nonce = ClNonce::new().expect("Error creating nonce"); let ser = serde_json::to_string(&nonce).unwrap(); let des = serde_json::from_str::(&ser).unwrap(); let ser2 = serde_json::to_string(&des).unwrap(); - let nonce_des = serde_json::from_str::(&ser2).unwrap(); + let nonce_des = serde_json::from_str::(&ser2).unwrap(); assert_eq!(nonce, nonce_des); let nonce = Nonce::new().unwrap();