mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-17 21:45:41 +00:00
Clippyfy (#6341)
* Add clippy config and remove .cargo from gitignore * first fixes * Clippyfied * Add clippy CI job * comment out rusty-cachier * minor * fix ci * remove DAG from check-dependent-project * add DAG to clippy Co-authored-by: alvicsam <alvicsam@gmail.com>
This commit is contained in:
@@ -32,7 +32,7 @@ use tempfile::tempdir;
|
||||
|
||||
pub mod common;
|
||||
|
||||
static RUNTIMES: [&'static str; 4] = ["polkadot", "kusama", "westend", "rococo"];
|
||||
static RUNTIMES: [&str; 4] = ["polkadot", "kusama", "westend", "rococo"];
|
||||
|
||||
/// `benchmark block` works for all dev runtimes using the wasm executor.
|
||||
#[tokio::test]
|
||||
@@ -54,7 +54,7 @@ async fn build_chain(runtime: &str, base_path: &Path) -> Result<(), String> {
|
||||
let mut cmd = Command::new(cargo_bin("polkadot"))
|
||||
.stdout(process::Stdio::piped())
|
||||
.stderr(process::Stdio::piped())
|
||||
.args(["--chain", &runtime, "--force-authoring", "--alice"])
|
||||
.args(["--chain", runtime, "--force-authoring", "--alice"])
|
||||
.arg("-d")
|
||||
.arg(base_path)
|
||||
.arg("--no-hardware-benchmarks")
|
||||
@@ -77,7 +77,7 @@ async fn build_chain(runtime: &str, base_path: &Path) -> Result<(), String> {
|
||||
fn benchmark_block(runtime: &str, base_path: &Path, block: u32) -> Result<(), String> {
|
||||
// Invoke `benchmark block` with all options to make sure that they are valid.
|
||||
let status = Command::new(cargo_bin("polkadot"))
|
||||
.args(["benchmark", "block", "--chain", &runtime])
|
||||
.args(["benchmark", "block", "--chain", runtime])
|
||||
.arg("-d")
|
||||
.arg(base_path)
|
||||
.args(["--from", &block.to_string(), "--to", &block.to_string()])
|
||||
|
||||
@@ -17,10 +17,9 @@
|
||||
use assert_cmd::cargo::cargo_bin;
|
||||
use std::{process::Command, result::Result};
|
||||
|
||||
static RUNTIMES: [&'static str; 4] = ["polkadot", "kusama", "westend", "rococo"];
|
||||
static RUNTIMES: [&str; 4] = ["polkadot", "kusama", "westend", "rococo"];
|
||||
|
||||
static EXTRINSICS: [(&'static str, &'static str); 2] =
|
||||
[("system", "remark"), ("balances", "transfer_keep_alive")];
|
||||
static EXTRINSICS: [(&str, &str); 2] = [("system", "remark"), ("balances", "transfer_keep_alive")];
|
||||
|
||||
/// `benchmark extrinsic` works for all dev runtimes and some extrinsics.
|
||||
#[test]
|
||||
@@ -43,8 +42,8 @@ fn benchmark_extrinsic_rejects_non_dev_runtimes() {
|
||||
|
||||
fn benchmark_extrinsic(runtime: &str, pallet: &str, extrinsic: &str) -> Result<(), String> {
|
||||
let status = Command::new(cargo_bin("polkadot"))
|
||||
.args(["benchmark", "extrinsic", "--chain", &runtime])
|
||||
.args(&["--pallet", pallet, "--extrinsic", extrinsic])
|
||||
.args(["benchmark", "extrinsic", "--chain", runtime])
|
||||
.args(["--pallet", pallet, "--extrinsic", extrinsic])
|
||||
// Run with low repeats for faster execution.
|
||||
.args(["--repeat=1", "--warmup=1", "--max-ext-per-block=1"])
|
||||
.status()
|
||||
|
||||
@@ -18,7 +18,7 @@ use assert_cmd::cargo::cargo_bin;
|
||||
use std::{process::Command, result::Result};
|
||||
use tempfile::tempdir;
|
||||
|
||||
static RUNTIMES: [&'static str; 4] = ["polkadot", "kusama", "westend", "rococo"];
|
||||
static RUNTIMES: [&str; 4] = ["polkadot", "kusama", "westend", "rococo"];
|
||||
|
||||
/// `benchmark overhead` works for all dev runtimes.
|
||||
#[test]
|
||||
|
||||
@@ -38,7 +38,7 @@ fn benchmark_storage_works() {
|
||||
/// Invoke the `benchmark storage` sub-command.
|
||||
fn benchmark_storage(db: &str, base_path: &Path) -> ExitStatus {
|
||||
Command::new(cargo_bin("polkadot"))
|
||||
.args(&["benchmark", "storage", "--dev"])
|
||||
.args(["benchmark", "storage", "--dev"])
|
||||
.arg("--db")
|
||||
.arg(db)
|
||||
.arg("--weight-path")
|
||||
|
||||
@@ -91,11 +91,13 @@ pub fn find_ws_url_from_output(read: impl Read + Send) -> (String, String) {
|
||||
// does the line contain our port (we expect this specific output from substrate).
|
||||
let sock_addr = match line.split_once("Running JSON-RPC WS server: addr=") {
|
||||
None => return None,
|
||||
Some((_, after)) => after.split_once(",").unwrap().0,
|
||||
Some((_, after)) => after.split_once(',').unwrap().0,
|
||||
};
|
||||
|
||||
Some(format!("ws://{}", sock_addr))
|
||||
})
|
||||
.expect(&format!("Could not find WebSocket address in process output:\n{}", &data));
|
||||
.unwrap_or_else(|| {
|
||||
panic!("Could not find WebSocket address in process output:\n{}", &data)
|
||||
});
|
||||
(ws_url, data)
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ fn invalid_order_arguments() {
|
||||
let tmpdir = tempdir().expect("could not create temp dir");
|
||||
|
||||
let status = Command::new(cargo_bin("polkadot"))
|
||||
.args(&["--dev", "invalid_order_arguments", "-d"])
|
||||
.args(["--dev", "invalid_order_arguments", "-d"])
|
||||
.arg(tmpdir.path())
|
||||
.arg("-y")
|
||||
.status()
|
||||
|
||||
@@ -36,7 +36,7 @@ async fn purge_chain_rocksdb_works() {
|
||||
let mut cmd = Command::new(cargo_bin("polkadot"))
|
||||
.stdout(process::Stdio::piped())
|
||||
.stderr(process::Stdio::piped())
|
||||
.args(&["--dev", "-d"])
|
||||
.args(["--dev", "-d"])
|
||||
.arg(tmpdir.path())
|
||||
.arg("--port")
|
||||
.arg("33034")
|
||||
@@ -61,7 +61,7 @@ async fn purge_chain_rocksdb_works() {
|
||||
|
||||
// Purge chain
|
||||
let status = Command::new(cargo_bin("polkadot"))
|
||||
.args(&["purge-chain", "--dev", "-d"])
|
||||
.args(["purge-chain", "--dev", "-d"])
|
||||
.arg(tmpdir.path())
|
||||
.arg("-y")
|
||||
.status()
|
||||
@@ -86,7 +86,7 @@ async fn purge_chain_paritydb_works() {
|
||||
let mut cmd = Command::new(cargo_bin("polkadot"))
|
||||
.stdout(process::Stdio::piped())
|
||||
.stderr(process::Stdio::piped())
|
||||
.args(&["--dev", "-d"])
|
||||
.args(["--dev", "-d"])
|
||||
.arg(tmpdir.path())
|
||||
.arg("--database")
|
||||
.arg("paritydb-experimental")
|
||||
@@ -111,7 +111,7 @@ async fn purge_chain_paritydb_works() {
|
||||
|
||||
// Purge chain
|
||||
let status = Command::new(cargo_bin("polkadot"))
|
||||
.args(&["purge-chain", "--dev", "-d"])
|
||||
.args(["purge-chain", "--dev", "-d"])
|
||||
.arg(tmpdir.path())
|
||||
.arg("--database")
|
||||
.arg("paritydb-experimental")
|
||||
|
||||
@@ -40,7 +40,7 @@ async fn running_the_node_works_and_can_be_interrupted() {
|
||||
let mut cmd = Command::new(cargo_bin("polkadot"))
|
||||
.stdout(process::Stdio::piped())
|
||||
.stderr(process::Stdio::piped())
|
||||
.args(&["--dev", "-d"])
|
||||
.args(["--dev", "-d"])
|
||||
.arg(tmpdir.path())
|
||||
.arg("--no-hardware-benchmarks")
|
||||
.spawn()
|
||||
|
||||
Reference in New Issue
Block a user