diff --git a/end2end-tests/tests/cucumber_tests.rs b/end2end-tests/tests/cucumber_tests.rs index faae00a9ba1557da4cc4ed2ad26c3ba4be8cb550..80a1772ac1ad1c1b5be78707b590a993721047bc 100644 --- a/end2end-tests/tests/cucumber_tests.rs +++ b/end2end-tests/tests/cucumber_tests.rs @@ -151,6 +151,7 @@ fn parse_amount(amount: u64, unit: &str) -> (u64, bool) { // ===== given ===== +#[allow(clippy::needless_pass_by_ref_mut)] #[given(regex = r"([a-zA-Z]+) ha(?:ve|s) (\d+) (ĞD|cĞD|UD|mUD)")] async fn who_have(world: &mut DuniterWorld, who: String, amount: u64, unit: String) -> Result<()> { // Parse inputs @@ -174,6 +175,7 @@ async fn who_have(world: &mut DuniterWorld, who: String, amount: u64, unit: Stri // ===== when ===== +#[allow(clippy::needless_pass_by_ref_mut)] #[when(regex = r"(\d+) blocks? later")] async fn n_blocks_later(world: &mut DuniterWorld, n: usize) -> Result<()> { for _ in 0..n { @@ -182,6 +184,7 @@ async fn n_blocks_later(world: &mut DuniterWorld, n: usize) -> Result<()> { Ok(()) } +#[allow(clippy::needless_pass_by_ref_mut)] #[when(regex = r"([a-zA-Z]+) sends? (\d+) (ĞD|cĞD|UD|mUD) to ([a-zA-Z]+)$")] async fn transfer( world: &mut DuniterWorld, @@ -208,6 +211,7 @@ async fn transfer( } } +#[allow(clippy::needless_pass_by_ref_mut)] #[when(regex = r"([a-zA-Z]+) sends? (\d+) (ĞD|cĞD) to oneshot ([a-zA-Z]+)")] async fn create_oneshot_account( world: &mut DuniterWorld, @@ -226,6 +230,7 @@ async fn create_oneshot_account( common::oneshot::create_oneshot_account(world.client(), from, amount, to).await } +#[allow(clippy::needless_pass_by_ref_mut)] #[when(regex = r"oneshot ([a-zA-Z]+) consumes? into (oneshot|account) ([a-zA-Z]+)")] async fn consume_oneshot_account( world: &mut DuniterWorld, @@ -249,6 +254,7 @@ async fn consume_oneshot_account( regex = r"oneshot ([a-zA-Z]+) consumes? (\d+) (ĞD|cĞD) into (oneshot|account) ([a-zA-Z]+) and the rest into (oneshot|account) ([a-zA-Z]+)" )] #[allow(clippy::too_many_arguments)] +#[allow(clippy::needless_pass_by_ref_mut)] async fn consume_oneshot_account_with_remaining( world: &mut DuniterWorld, from: String, @@ -287,6 +293,7 @@ async fn consume_oneshot_account_with_remaining( .await } +#[allow(clippy::needless_pass_by_ref_mut)] #[when(regex = r"([a-zA-Z]+) sends? all (?:his|her) (?:ĞDs?|DUs?|UDs?) to ([a-zA-Z]+)")] async fn send_all_to(world: &mut DuniterWorld, from: String, to: String) -> Result<()> { // Parse inputs @@ -296,6 +303,7 @@ async fn send_all_to(world: &mut DuniterWorld, from: String, to: String) -> Resu common::balances::transfer_all(world.client(), from, to).await } +#[allow(clippy::needless_pass_by_ref_mut)] #[when(regex = r"([a-zA-Z]+) certifies ([a-zA-Z]+)")] async fn certifies(world: &mut DuniterWorld, from: String, to: String) -> Result<()> { // Parse inputs @@ -305,6 +313,7 @@ async fn certifies(world: &mut DuniterWorld, from: String, to: String) -> Result common::cert::certify(world.client(), from, to).await } +#[allow(clippy::needless_pass_by_ref_mut)] #[when(regex = r"([a-zA-Z]+) creates identity for ([a-zA-Z]+)")] async fn creates_identity(world: &mut DuniterWorld, from: String, to: String) -> Result<()> { // Parse inputs @@ -314,6 +323,7 @@ async fn creates_identity(world: &mut DuniterWorld, from: String, to: String) -> common::identity::create_identity(world.client(), from, to).await } +#[allow(clippy::needless_pass_by_ref_mut)] #[when(regex = r#"([a-zA-Z]+) confirms (?:his|her) identity with pseudo "([a-zA-Z]+)""#)] async fn confirm_identity(world: &mut DuniterWorld, from: String, pseudo: String) -> Result<()> { let from = AccountKeyring::from_str(&from).expect("unknown from"); @@ -321,6 +331,7 @@ async fn confirm_identity(world: &mut DuniterWorld, from: String, pseudo: String common::identity::confirm_identity(world.client(), from, pseudo).await } +#[allow(clippy::needless_pass_by_ref_mut)] #[when(regex = r#"([a-zA-Z]+) validates ([a-zA-Z]+) identity"#)] async fn validate_identity(world: &mut DuniterWorld, from: String, to: String) -> Result<()> { // input names to keyrings @@ -332,6 +343,7 @@ async fn validate_identity(world: &mut DuniterWorld, from: String, to: String) - common::identity::validate_identity(world.client(), from, to).await } +#[allow(clippy::needless_pass_by_ref_mut)] #[when(regex = r#"([a-zA-Z]+) requests distance evaluation"#)] async fn request_distance_evaluation(world: &mut DuniterWorld, who: String) -> Result<()> { let who = AccountKeyring::from_str(&who).expect("unknown origin"); @@ -339,6 +351,7 @@ async fn request_distance_evaluation(world: &mut DuniterWorld, who: String) -> R common::distance::request_evaluation(world.client(), who).await } +#[allow(clippy::needless_pass_by_ref_mut)] #[when(regex = r#"([a-zA-Z]+) runs distance oracle"#)] async fn run_distance_oracle(world: &mut DuniterWorld, who: String) -> Result<()> { let who = AccountKeyring::from_str(&who).expect("unknown origin"); @@ -353,6 +366,7 @@ async fn run_distance_oracle(world: &mut DuniterWorld, who: String) -> Result<() // ===== then ==== +#[allow(clippy::needless_pass_by_ref_mut)] #[then(regex = r"([a-zA-Z]+) should have (\d+) (ĞD|cĞD)")] async fn should_have( world: &mut DuniterWorld, @@ -375,6 +389,7 @@ async fn should_have( Ok(()) } +#[allow(clippy::needless_pass_by_ref_mut)] #[then(regex = r"([a-zA-Z]+) should have oneshot (\d+) (ĞD|cĞD)")] async fn should_have_oneshot( world: &mut DuniterWorld, @@ -397,6 +412,7 @@ async fn should_have_oneshot( Ok(()) } +#[allow(clippy::needless_pass_by_ref_mut)] #[then(regex = r"Current UD amount should be (\d+).(\d+)")] async fn current_ud_amount_should_be( world: &mut DuniterWorld, @@ -412,6 +428,7 @@ async fn current_ud_amount_should_be( Ok(()) } +#[allow(clippy::needless_pass_by_ref_mut)] #[then(regex = r"Monetary mass should be (\d+).(\d+)")] async fn monetary_mass_should_be(world: &mut DuniterWorld, amount: u64, cents: u64) -> Result<()> { let expected = (amount * 100) + cents; @@ -423,6 +440,7 @@ async fn monetary_mass_should_be(world: &mut DuniterWorld, amount: u64, cents: u Ok(()) } +#[allow(clippy::needless_pass_by_ref_mut)] #[then(regex = r"([a-zA-Z]+) should be certified by ([a-zA-Z]+)")] async fn should_be_certified_by( world: &mut DuniterWorld, @@ -477,6 +495,7 @@ async fn should_be_certified_by( } } +#[allow(clippy::needless_pass_by_ref_mut)] #[then(regex = r"([a-zA-Z]+) should have distance result in (\d+) sessions?")] async fn should_have_distance_result_in_sessions( world: &mut DuniterWorld, @@ -520,6 +539,7 @@ async fn should_have_distance_result_in_sessions( Err(anyhow::anyhow!("no evaluation in given pool").into()) } +#[allow(clippy::needless_pass_by_ref_mut)] #[then(regex = r"([a-zA-Z]+) should have distance ok")] async fn should_have_distance_ok(world: &mut DuniterWorld, who: String) -> Result<()> { let who = AccountKeyring::from_str(&who).unwrap().to_account_id(); @@ -559,6 +579,7 @@ impl FromStr for IdtyStatus { } } +#[allow(clippy::needless_pass_by_ref_mut)] #[then(regex = r"([a-zA-Z]+) identity should be ([a-zA-Z ]+)")] async fn identity_status_should_be( world: &mut DuniterWorld,