mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 08:37:56 +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:
@@ -58,6 +58,8 @@ unused_extern_crates = "deny"
|
||||
[workspace.lints.clippy]
|
||||
type_complexity = "allow"
|
||||
all = "deny"
|
||||
# https://github.com/rust-lang/rust-clippy/issues/12643
|
||||
manual-unwrap-or-default = "allow"
|
||||
|
||||
[workspace.dependencies]
|
||||
async-trait = "0.1.80"
|
||||
|
||||
@@ -43,3 +43,6 @@ rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[package.metadata.playground]
|
||||
defalt-features = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
+3
-1
@@ -35,7 +35,6 @@ std = [
|
||||
substrate-compat = ["sp-core", "sp-runtime"]
|
||||
|
||||
[dependencies]
|
||||
|
||||
codec = { package = "parity-scale-codec", workspace = true, default-features = false, features = ["derive"] }
|
||||
scale-info = { workspace = true, default-features = false, features = ["bit-vec"] }
|
||||
scale-value = { workspace = true, default-features = false }
|
||||
@@ -83,3 +82,6 @@ rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[package.metadata.playground]
|
||||
defalt-features = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
@@ -27,3 +27,6 @@ syn = { workspace = true }
|
||||
quote = { workspace = true }
|
||||
subxt-codegen = { workspace = true, features = ["fetch-metadata"] }
|
||||
scale-typegen = { workspace = true }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
+3
-2
@@ -3,8 +3,8 @@
|
||||
// see LICENSE for license details.
|
||||
|
||||
//! Subxt macro for generating Substrate runtime interfaces.
|
||||
|
||||
extern crate proc_macro;
|
||||
// TODO: The workspace lint is not working properly so it's disabled here for now.
|
||||
#![allow(clippy::manual_unwrap_or_default)]
|
||||
|
||||
use codec::Decode;
|
||||
use darling::{ast::NestedMeta, FromMeta};
|
||||
@@ -85,6 +85,7 @@ struct SubstituteType {
|
||||
}
|
||||
|
||||
// Note: docs for this are in the subxt library; don't add further docs here as they will be appended.
|
||||
#[allow(missing_docs)]
|
||||
#[proc_macro_attribute]
|
||||
#[proc_macro_error]
|
||||
pub fn subxt(args: TokenStream, input: TokenStream) -> TokenStream {
|
||||
|
||||
@@ -37,3 +37,6 @@ bench = false
|
||||
[[bench]]
|
||||
name = "bench"
|
||||
harness = false
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
@@ -3,7 +3,7 @@
|
||||
// see LICENSE for license details.
|
||||
|
||||
//! Benchmarks for metadata hashing.
|
||||
|
||||
#![allow(missing_docs)]
|
||||
use codec::Decode;
|
||||
use criterion::*;
|
||||
use frame_metadata::{RuntimeMetadata, RuntimeMetadataPrefixed};
|
||||
@@ -92,4 +92,5 @@ criterion_group!(
|
||||
bench_get_constant_hash,
|
||||
bench_get_storage_hash,
|
||||
);
|
||||
|
||||
criterion_main!(benches);
|
||||
|
||||
@@ -79,3 +79,6 @@ rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[package.metadata.playground]
|
||||
defalt-features = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
@@ -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