mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Add workspace lints
This commit is contained in:
@@ -12,6 +12,9 @@ rust-version = "1.69"
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
scale = { package = "parity-scale-codec", version = "3", features = ["derive"] }
|
||||
scale-info = { version = "2", features = ["derive"] }
|
||||
|
||||
@@ -13,6 +13,9 @@ rust-version = "1.74"
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
zeroize = "^1.5"
|
||||
thiserror = { version = "1", optional = true }
|
||||
|
||||
@@ -317,7 +317,6 @@ impl<'a> TemporalSerai<'a> {
|
||||
if events.is_none() {
|
||||
drop(events);
|
||||
let mut events_write = self.events.write().await;
|
||||
#[allow(clippy::unwrap_or_default)]
|
||||
if events_write.is_none() {
|
||||
*events_write = Some(self.storage("System", "Events", ()).await?.unwrap_or(vec![]));
|
||||
}
|
||||
|
||||
@@ -15,6 +15,9 @@ rustdoc-args = ["--cfg", "docsrs"]
|
||||
[package.metadata.cargo-machete]
|
||||
ignored = ["scale", "scale-info"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
|
||||
scale-info = { version = "2", default-features = false, features = ["derive"] }
|
||||
|
||||
@@ -12,6 +12,7 @@ impl AllowMint for () {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::cast_possible_truncation)] // TODO: Investigate why Substrate generates this
|
||||
#[frame_support::pallet]
|
||||
pub mod pallet {
|
||||
use super::*;
|
||||
|
||||
@@ -11,6 +11,9 @@ rust-version = "1.69"
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
zeroize = { version = "^1.5", features = ["derive"], optional = true }
|
||||
|
||||
|
||||
@@ -15,6 +15,9 @@ rustdoc-args = ["--cfg", "docsrs"]
|
||||
[package.metadata.cargo-machete]
|
||||
ignored = ["scale", "scale-info"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
scale = { package = "parity-scale-codec", version = "3.6.1", default-features = false }
|
||||
scale-info = { version = "2.5.0", default-features = false, features = ["derive"] }
|
||||
|
||||
@@ -94,6 +94,7 @@ use sp_std::prelude::*;
|
||||
pub use types::*;
|
||||
pub use weights::WeightInfo;
|
||||
|
||||
#[allow(clippy::cast_possible_truncation)] // TODO: Investigate why Substrate generates this
|
||||
#[frame_support::pallet]
|
||||
pub mod pallet {
|
||||
use super::*;
|
||||
@@ -751,7 +752,7 @@ pub mod pallet {
|
||||
)?;
|
||||
|
||||
let mut i = 0;
|
||||
let path_len = path.len() as u32;
|
||||
let path_len = u32::try_from(path.len()).unwrap();
|
||||
#[allow(clippy::explicit_counter_loop)]
|
||||
for coins_pair in path.windows(2) {
|
||||
if let [coin1, coin2] = coins_pair {
|
||||
|
||||
@@ -15,6 +15,9 @@ rustdoc-args = ["--cfg", "docsrs"]
|
||||
[package.metadata.cargo-machete]
|
||||
ignored = ["scale", "scale-info"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "max-encoded-len"] }
|
||||
scale-info = { version = "2", default-features = false, features = ["derive"] }
|
||||
|
||||
@@ -9,6 +9,7 @@ use serai_primitives::{BlockHash, NetworkId};
|
||||
pub use in_instructions_primitives as primitives;
|
||||
use primitives::*;
|
||||
|
||||
#[allow(clippy::cast_possible_truncation)] // TODO: Investigate why Substrate generates this
|
||||
#[frame_support::pallet]
|
||||
pub mod pallet {
|
||||
use sp_std::vec;
|
||||
|
||||
@@ -11,6 +11,9 @@ rust-version = "1.69"
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
zeroize = { version = "^1.5", features = ["derive"], optional = true }
|
||||
|
||||
|
||||
@@ -9,6 +9,13 @@ edition = "2021"
|
||||
publish = false
|
||||
rust-version = "1.74"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[[bin]]
|
||||
name = "serai-node"
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ pub fn new_partial(config: &Configuration) -> Result<PartialComponents, ServiceE
|
||||
justification_import: Some(Box::new(justification_import)),
|
||||
client: client.clone(),
|
||||
select_chain: select_chain.clone(),
|
||||
create_inherent_data_providers: move |_, _| async move {
|
||||
create_inherent_data_providers: move |_, ()| async move {
|
||||
Ok(create_inherent_data_providers(slot_duration))
|
||||
},
|
||||
spawner: &task_manager.spawn_essential_handle(),
|
||||
@@ -259,7 +259,7 @@ pub async fn new_full(config: Configuration) -> Result<TaskManager, ServiceError
|
||||
block_import,
|
||||
sync_oracle: sync_service.clone(),
|
||||
justification_sync_link: sync_service.clone(),
|
||||
create_inherent_data_providers: move |_, _| async move {
|
||||
create_inherent_data_providers: move |_, ()| async move {
|
||||
Ok(create_inherent_data_providers(slot_duration))
|
||||
},
|
||||
force_authoring,
|
||||
|
||||
@@ -12,6 +12,9 @@ rust-version = "1.69"
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
zeroize = { version = "^1.5", features = ["derive"], optional = true }
|
||||
|
||||
|
||||
@@ -15,6 +15,9 @@ rustdoc-args = ["--cfg", "docsrs"]
|
||||
[package.metadata.cargo-machete]
|
||||
ignored = ["scale", "scale-info"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
|
||||
scale-info = { version = "2", default-features = false, features = ["derive"] }
|
||||
|
||||
@@ -268,8 +268,10 @@ impl Convert<PublicKey, Option<PublicKey>> for IdentityValidatorIdOf {
|
||||
impl signals::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
// 1 week
|
||||
#[allow(clippy::cast_possible_truncation)]
|
||||
type RetirementValidityDuration = ConstU32<{ (7 * 24 * 60 * 60) / (TARGET_BLOCK_TIME as u32) }>;
|
||||
// 2 weeks
|
||||
#[allow(clippy::cast_possible_truncation)]
|
||||
type RetirementLockInDuration = ConstU32<{ (2 * 7 * 24 * 60 * 60) / (TARGET_BLOCK_TIME as u32) }>;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,9 @@ rustdoc-args = ["--cfg", "docsrs"]
|
||||
[package.metadata.cargo-machete]
|
||||
ignored = ["scale", "scale-info"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
|
||||
scale-info = { version = "2", default-features = false, features = ["derive"] }
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
#[allow(deprecated, clippy::let_unit_value)] // TODO
|
||||
#[allow(
|
||||
deprecated,
|
||||
clippy::let_unit_value,
|
||||
clippy::cast_possible_truncation,
|
||||
clippy::ignored_unit_patterns
|
||||
)] // TODO
|
||||
#[frame_support::pallet]
|
||||
pub mod pallet {
|
||||
use scale_info::TypeInfo;
|
||||
|
||||
@@ -12,6 +12,9 @@ rust-version = "1.74"
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
zeroize = { version = "^1.5", features = ["derive"], optional = true }
|
||||
|
||||
|
||||
@@ -15,6 +15,9 @@ rustdoc-args = ["--cfg", "docsrs"]
|
||||
[package.metadata.cargo-machete]
|
||||
ignored = ["scale", "scale-info"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
hashbrown = { version = "0.14", default-features = false, features = ["ahash", "inline-more"] }
|
||||
|
||||
|
||||
@@ -53,11 +53,16 @@ impl<T: pallet::Config> GetValidatorCount for MembershipProof<T> {
|
||||
// rely on it and Substrate only relies on it to offer economic calculations we also don't rely
|
||||
// on
|
||||
fn validator_count(&self) -> u32 {
|
||||
Babe::<T>::authorities().len() as u32
|
||||
u32::try_from(Babe::<T>::authorities().len()).unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(deprecated, clippy::let_unit_value)] // TODO
|
||||
#[allow(
|
||||
deprecated,
|
||||
clippy::let_unit_value,
|
||||
clippy::cast_possible_truncation,
|
||||
clippy::ignored_unit_patterns
|
||||
)] // TODO
|
||||
#[frame_support::pallet]
|
||||
pub mod pallet {
|
||||
use super::*;
|
||||
@@ -717,7 +722,7 @@ pub mod pallet {
|
||||
None,
|
||||
),
|
||||
WeakBoundedVec::force_from(
|
||||
next_validators.iter().cloned().map(|(id, w)| (BabeAuthorityId::from(id), w)).collect(),
|
||||
next_validators.iter().copied().map(|(id, w)| (BabeAuthorityId::from(id), w)).collect(),
|
||||
None,
|
||||
),
|
||||
Some(session),
|
||||
|
||||
@@ -12,6 +12,9 @@ rust-version = "1.74"
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
zeroize = { version = "^1.5", features = ["derive"], optional = true }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user