-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: check signature s during recovery (#14)
* feat: check signature s during recovery * error impl * fix * rm core::error
- Loading branch information
Showing
5 changed files
with
45 additions
and
3 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
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use alloy_primitives::U256; | ||
|
||
/// EIP-7702 error. | ||
#[derive(Debug, derive_more::Display, derive_more::From)] | ||
pub enum Eip7702Error { | ||
/// Invalid signature `s` value. | ||
#[display("invalid signature `s` value: {_0}")] | ||
InvalidSValue(U256), | ||
/// Signature error. | ||
#[from] | ||
Signature(alloy_primitives::SignatureError), | ||
} | ||
|
||
#[cfg(feature = "std")] | ||
impl std::error::Error for Eip7702Error { | ||
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { | ||
match self { | ||
Self::InvalidSValue(_) => None, | ||
Self::Signature(err) => Some(err), | ||
} | ||
} | ||
} |
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