-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
163 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,27 @@ | ||
use thiserror::Error; | ||
|
||
/// Error types. | ||
#[derive(Error, Debug)] | ||
pub enum Error { | ||
/// Unsupported multikey type. | ||
#[error("Unsupported key type")] | ||
UnsupportedMultikeyType, | ||
/// Incorrect prefix for DID key. | ||
#[error("Incorrect prefix for did:key: {0}")] | ||
IncorrectDIDKeyPrefix(String), | ||
#[error("Low-S Signature is not allowed")] | ||
/// Low-S signature is not allowed. | ||
#[error("Low-S signature is not allowed")] | ||
LowSSignatureNotAllowed, | ||
/// Signature is invalid. | ||
#[error("Signature is invalid")] | ||
InvalidSignature, | ||
/// Error in [`multibase`] encoding or decoding. | ||
#[error(transparent)] | ||
Multibase(#[from] multibase::Error), | ||
/// Error in [`ecdsa::signature`]. | ||
#[error(transparent)] | ||
Signature(#[from] ecdsa::signature::Error), | ||
} | ||
|
||
/// Type alias to use this library's [`Error`](crate::Error) type in a [`Result`](core::result::Result). | ||
pub type Result<T> = std::result::Result<T, Error>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters