mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 20:31:13 +00:00
Disable clippy::unwrap_or_default lint for the project (#1647)
* disable clippy lint trigerred by a macro * typo in lint name * Update macro/src/lib.rs Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com> * move missing docs * add workspace.lints = true for remaining crates * lint fixes * Update signer/src/eth.rs Co-authored-by: James Wilson <james@jsdw.me> --------- Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com> Co-authored-by: James Wilson <james@jsdw.me>
This commit is contained in:
@@ -207,6 +207,18 @@ impl Display for AccountId20 {
|
||||
}
|
||||
}
|
||||
|
||||
/// Verify that some signature for a message was created by the owner of the [`PublicKey`].
|
||||
///
|
||||
/// ```rust
|
||||
/// use subxt_signer::{ bip39::Mnemonic, eth };
|
||||
///
|
||||
/// let keypair = eth::dev::alith();
|
||||
/// let message = b"Hello!";
|
||||
///
|
||||
/// let signature = keypair.sign(message);
|
||||
/// let public_key = keypair.public_key();
|
||||
/// assert!(eth::verify(&signature, message, &public_key));
|
||||
/// ```
|
||||
pub fn verify<M: AsRef<[u8]>>(sig: &Signature, message: M, pubkey: &ecdsa::PublicKey) -> bool {
|
||||
let message_hash = keccak(message.as_ref());
|
||||
let wrapped =
|
||||
|
||||
@@ -21,6 +21,7 @@ macro_rules! once_static_cloned {
|
||||
($($(#[$attr:meta])* $vis:vis fn $name:ident() -> $ty:ty { $expr:expr } )+) => {
|
||||
$(
|
||||
$(#[$attr])*
|
||||
#[allow(missing_docs)]
|
||||
$vis fn $name() -> $ty {
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(feature = "std")] {
|
||||
|
||||
Reference in New Issue
Block a user