mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
Run latest nightly clippy
Also runs clippy on the tests and updates the CI accordingly
This commit is contained in:
@@ -11,7 +11,7 @@ use serai_runtime::{
|
||||
pub type ChainSpec = sc_service::GenericChainSpec<GenesisConfig>;
|
||||
|
||||
fn insecure_pair_from_name(name: &'static str) -> Pair {
|
||||
Pair::from_string(&format!("//{}", name), None).unwrap()
|
||||
Pair::from_string(&format!("//{name}"), None).unwrap()
|
||||
}
|
||||
|
||||
fn account_id_from_name(name: &'static str) -> AccountId {
|
||||
|
||||
@@ -90,6 +90,6 @@ pub fn inherent_benchmark_data() -> Result<InherentData> {
|
||||
let mut inherent_data = InherentData::new();
|
||||
sp_timestamp::InherentDataProvider::new(Duration::from_millis(0).into())
|
||||
.provide_inherent_data(&mut inherent_data)
|
||||
.map_err(|e| format!("creating inherent data: {:?}", e))?;
|
||||
.map_err(|e| format!("creating inherent data: {e:?}"))?;
|
||||
Ok(inherent_data)
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ where
|
||||
return Ok((block, None));
|
||||
}
|
||||
|
||||
self.check(&mut block).await.map_err(|e| format!("{}", e))?;
|
||||
self.check(&mut block).await.map_err(|e| format!("{e}"))?;
|
||||
Ok((block, None))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ const PROTOCOL_NAME: &str = "/tendermint/1";
|
||||
pub fn protocol_name<Hash: AsRef<[u8]>>(genesis: Hash, fork: Option<&str>) -> ProtocolName {
|
||||
let mut name = format!("/{}", hex::encode(genesis.as_ref()));
|
||||
if let Some(fork) = fork {
|
||||
name += &format!("/{}", fork);
|
||||
name += &format!("/{fork}");
|
||||
}
|
||||
name += PROTOCOL_NAME;
|
||||
name.into()
|
||||
|
||||
@@ -44,7 +44,7 @@ impl SignatureScheme for TestSignatureScheme {
|
||||
|
||||
#[must_use]
|
||||
fn verify(&self, validator: u16, msg: &[u8], sig: &[u8; 32]) -> bool {
|
||||
(sig[.. 2] == validator.to_le_bytes()) && (&sig[2 ..] == &[msg, &[0; 30]].concat()[.. 30])
|
||||
(sig[.. 2] == validator.to_le_bytes()) && (sig[2 ..] == [msg, &[0; 30]].concat()[.. 30])
|
||||
}
|
||||
|
||||
fn aggregate(sigs: &[[u8; 32]]) -> Vec<[u8; 32]> {
|
||||
@@ -96,6 +96,7 @@ impl Block for TestBlock {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::type_complexity)]
|
||||
struct TestNetwork(u16, Arc<RwLock<Vec<(MessageSender<Self>, StepSender<Self>)>>>);
|
||||
|
||||
#[async_trait]
|
||||
|
||||
Reference in New Issue
Block a user