Skip to content

Commit

Permalink
Rename EcdsaRecoverEcdsaRecovery (use-ink#1064)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Müller authored and xgreenx committed Feb 8, 2022
1 parent ab9c0a3 commit c97f6a3
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions crates/engine/src/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ define_error_codes! {
/// recording was disabled.
LoggingDisabled = 9,
/// ECDSA pubkey recovery failed. Most probably wrong recovery id or signature.
EcdsaRecoverFailed = 11,
EcdsaRecoveryFailed = 11,
}

/// The raw return code returned by the host side.
Expand Down Expand Up @@ -423,7 +423,7 @@ impl Engine {
*output = pub_key.serialize();
Ok(())
}
Err(_) => Err(Error::EcdsaRecoverFailed),
Err(_) => Err(Error::EcdsaRecoveryFailed),
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions crates/env/src/engine/experimental_off_chain/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl From<ext::Error> for crate::Error {
ext::Error::CodeNotFound => Self::CodeNotFound,
ext::Error::NotCallable => Self::NotCallable,
ext::Error::LoggingDisabled => Self::LoggingDisabled,
ext::Error::EcdsaRecoverFailed => Self::EcdsaRecoverFailed,
ext::Error::EcdsaRecoveryFailed => Self::EcdsaRecoveryFailed,
}
}
}
Expand Down Expand Up @@ -285,7 +285,7 @@ impl EnvBackend for EnvInstance {
*output = pub_key.serialize();
Ok(())
}
Err(_) => Err(Error::EcdsaRecoverFailed),
Err(_) => Err(Error::EcdsaRecoveryFailed),
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/env/src/engine/off_chain/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ impl EnvBackend for EnvInstance {
*output = pub_key.serialize();
Ok(())
}
Err(_) => Err(Error::EcdsaRecoverFailed),
Err(_) => Err(Error::EcdsaRecoveryFailed),
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/env/src/engine/on_chain/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ define_error_codes! {
/// recording was disabled.
LoggingDisabled = 9,
/// ECDSA pubkey recovery failed. Most probably wrong recovery id or signature.
EcdsaRecoverFailed = 11,
EcdsaRecoveryFailed = 11,
}

/// Thin-wrapper around a `u32` representing a pointer for Wasm32.
Expand Down
2 changes: 1 addition & 1 deletion crates/env/src/engine/on_chain/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl From<ext::Error> for Error {
ext::Error::CodeNotFound => Self::CodeNotFound,
ext::Error::NotCallable => Self::NotCallable,
ext::Error::LoggingDisabled => Self::LoggingDisabled,
ext::Error::EcdsaRecoverFailed => Self::EcdsaRecoverFailed,
ext::Error::EcdsaRecoveryFailed => Self::EcdsaRecoveryFailed,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/env/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub enum Error {
/// recording was disabled.
LoggingDisabled,
/// ECDSA pubkey recovery failed. Most probably wrong recovery id or signature.
EcdsaRecoverFailed,
EcdsaRecoveryFailed,
}

/// A result of environmental operations.
Expand Down
4 changes: 2 additions & 2 deletions crates/lang/src/env_access.rs
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ where
/// let failed_result = self.env().ecdsa_recover(&signature, &[0; 32]);
/// assert!(failed_result.is_err());
/// if let Err(e) = failed_result {
/// assert_eq!(e, ink_env::Error::EcdsaRecoverFailed);
/// assert_eq!(e, ink_env::Error::EcdsaRecoveryFailed);
/// }
/// }
/// #
Expand All @@ -836,6 +836,6 @@ where
let mut output = [0; 33];
ink_env::ecdsa_recover(signature, message_hash, &mut output)
.map(|_| output.into())
.map_err(|_| Error::EcdsaRecoverFailed)
.map_err(|_| Error::EcdsaRecoveryFailed)
}
}

0 comments on commit c97f6a3

Please sign in to comment.