fix: custom k256 error

This commit is contained in:
hade 2024-05-30 16:13:51 +07:00
parent c9a15194a0
commit 740e140c89
No known key found for this signature in database
GPG Key ID: 706945D35C5E919B
1 changed files with 9 additions and 2 deletions

View File

@ -72,6 +72,13 @@ pub enum Error {
#[error(transparent)] #[error(transparent)]
Secp256k1(#[from] secp256k1::Error), Secp256k1(#[from] secp256k1::Error),
#[cfg(target_family = "wasm")] #[cfg(target_family = "wasm")]
#[error(transparent)] #[error("{0}")]
Secp256k1(#[from] k256::ecdsa::Error), K256Error(String),
}
#[cfg(target_family = "wasm")]
impl From<k256::ecdsa::Error> for Error {
fn from(error: k256::ecdsa::Error) -> Error {
Error::K256Error(format!("K256 error: {}", error))
}
} }