Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions crates/astria-core/src/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ impl TryFrom<&[u8]> for VerificationKey {
type Error = Error;

fn try_from(slice: &[u8]) -> Result<Self, Error> {
let key = Ed25519VerificationKey::try_from(slice)?;
let key = Ed25519VerificationKey::try_from(slice).map_err(Error)?;
Ok(Self {
key,
})
Expand All @@ -225,7 +225,7 @@ impl TryFrom<[u8; 32]> for VerificationKey {
type Error = Error;

fn try_from(bytes: [u8; 32]) -> Result<Self, Self::Error> {
let key = Ed25519VerificationKey::try_from(bytes)?;
let key = Ed25519VerificationKey::try_from(bytes).map_err(Error)?;
Ok(Self {
key,
})
Expand Down Expand Up @@ -266,15 +266,15 @@ impl TryFrom<&[u8]> for Signature {
type Error = Error;

fn try_from(slice: &[u8]) -> Result<Self, Error> {
let signature = Ed25519Signature::try_from(slice)?;
let signature = Ed25519Signature::try_from(slice).map_err(Error)?;
Ok(Self(signature))
}
}

/// An error related to Ed25519 signing.
#[derive(Copy, Clone, Eq, PartialEq, thiserror::Error, Debug)]
#[error(transparent)]
pub struct Error(#[from] Ed25519Error);
pub struct Error(Ed25519Error);

#[cfg(test)]
mod tests {
Expand Down