message: Add StdError -> VerificationError mapping
diff: @@ -6,6 +6,8 @@ use thiserror::Error;
  #[cfg(not(target_arch = "wasm32"))]
  use cosmwasm_crypto::CryptoError;
  +use crate::errors::StdError;
  +
  #[derive(Error, Debug)]
  pub enum VerificationError {
  #[error("Generic error")]
  @@ -20,6 +22,12 @@ pub enum VerificationError {
  PublicKeyErr,
  #[error("Invalid recovery parameter. Supported values: 0 and 1.")]
  InvalidRecoveryParam,
  + #[error("Standard error: {msg}")]
  + StandardErr {
  + msg: String,
  + #[cfg(feature = "backtraces")]
  + backtrace: Backtrace,
  + },
  #[error("Unknown error: {error_code}")]
  UnknownErr {
  error_code: u32,
  @@ -29,6 +37,14 @@ pub enum VerificationError {
  }
  impl VerificationError {
  + pub fn standard_err(msg: String) -> Self {
  + VerificationError::StandardErr {
  + msg,
  + #[cfg(feature = "backtraces")]
  + backtrace: Backtrace::capture(),
  + }
  + }
  +
  pub fn unknown_err(error_code: u32) -> Self {
  VerificationError::UnknownErr {
  error_code,
  @@ -48,6 +64,12 @@ impl PartialEq<VerificationError> for VerificationError {
  VerificationError::PublicKeyErr => matches!(rhs, VerificationError::PublicKeyErr),
  VerificationError::InvalidRecoveryParam => {
  matches!(rhs, VerificationError::InvalidRecoveryParam)
  + VerificationError::StandardErr { msg, .. } => {
  + if let VerificationError::StandardErr { msg: rhs_msg, .. } = rhs {
  + msg == rhs_msg
  + } else {
  + false
  + }
  }
  VerificationError::UnknownErr { error_code, .. } => {
  if let VerificationError::UnknownErr {
  @@ -78,11 +100,28 @@ impl From<CryptoError> for VerificationError {
  }
  }
  +impl From<StdError> for VerificationError {
  + fn from(original: StdError) -> Self {
  + VerificationError::standard_err(format!("{:?}", original))
  + }
  +}
  +
  #[cfg(test)]
  mod tests {
  use super::*;
  // constructors
  + #[test]
  + fn standard_err_works() {
  + let error = VerificationError::standard_err("standard error message here".into());
  + match error {
  + VerificationError::StandardErr { msg, .. } => {
  + assert_eq!(msg, "standard error message here")
  + }
  + _ => panic!("wrong error type!"),
  + }
  + }
  +
  #[test]
  fn unknown_err_works() {
  let error = VerificationError::unknown_err(123);
  