From 0c63ba30991dc5cd55d5841e51af7c5c642c256c Mon Sep 17 00:00:00 2001 From: cong-or Date: Thu, 15 Feb 2024 23:41:18 +0000 Subject: [PATCH 01/20] bump version to 1.75 --- .github/workflows/build-earthly.yml | 2 +- .github/workflows/build.yml | 2 +- .github/workflows/ci-tests-n-coverage.yml | 2 +- .github/workflows/rust.yml | 2 +- Earthfile | 2 +- docker/catalyst-core-base.dockerfile | 2 +- rust-toolchain | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-earthly.yml b/.github/workflows/build-earthly.yml index 4a9492ecfd..02d635251c 100644 --- a/.github/workflows/build-earthly.yml +++ b/.github/workflows/build-earthly.yml @@ -22,7 +22,7 @@ on: - "book/**" env: - RUST_LATEST_STABLE_VERSION: 1.71 + RUST_LATEST_STABLE_VERSION: 1.75 CARGO_TERM_COLOR: always RUSTFLAGS: -D warnings RUST_BACKTRACE: 1 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7929ac1caf..62e07a6aca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ on: - "book/**" env: - RUST_LATEST_STABLE_VERSION: 1.71 + RUST_LATEST_STABLE_VERSION: 1.75 CARGO_TERM_COLOR: always RUSTFLAGS: -D warnings RUST_BACKTRACE: 1 diff --git a/.github/workflows/ci-tests-n-coverage.yml b/.github/workflows/ci-tests-n-coverage.yml index 7b5a11e74d..fb02d39e0d 100644 --- a/.github/workflows/ci-tests-n-coverage.yml +++ b/.github/workflows/ci-tests-n-coverage.yml @@ -6,7 +6,7 @@ on: - cron: '5 0 * * *' env: - RUST_LATEST_STABLE_VERSION: 1.71 + RUST_LATEST_STABLE_VERSION: 1.75 CARGO_TERM_COLOR: always RUSTFLAGS: -D warnings RUST_BACKTRACE: 1 diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 5531f0eee5..881dda2a86 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -20,7 +20,7 @@ on: - 'book/**' env: - RUST_LATEST_STABLE_VERSION: 1.71 + RUST_LATEST_STABLE_VERSION: 1.75 CARGO_TERM_COLOR: always RUSTFLAGS: -D warnings RUST_BACKTRACE: 1 diff --git a/Earthfile b/Earthfile index b762609895..fb2bdcd09e 100644 --- a/Earthfile +++ b/Earthfile @@ -3,7 +3,7 @@ VERSION 0.7 FROM debian:stable-slim rust-toolchain: - FROM rust:1.71.0-slim-bullseye + FROM rust:1.75.0-slim-bullseye # Installs Cargo chef install-chef: diff --git a/docker/catalyst-core-base.dockerfile b/docker/catalyst-core-base.dockerfile index 775dfb10f4..b7e7168a59 100644 --- a/docker/catalyst-core-base.dockerfile +++ b/docker/catalyst-core-base.dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.71.0-slim-bullseye +FROM rust:1.75.0-slim-bullseye WORKDIR /usr/src/catalyst-core COPY . . RUN apt-get update && \ diff --git a/rust-toolchain b/rust-toolchain index f54a91728a..94ba84aeb3 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,3 +1,3 @@ [toolchain] -channel = "1.71.0" +channel = "1.75.0" components = ["rust-src", "rustfmt", "rust-std"] From a75b803c36e101436e65b2831ce2d83a3feebaed Mon Sep 17 00:00:00 2001 From: cong-or Date: Fri, 16 Feb 2024 11:20:37 +0000 Subject: [PATCH 02/20] fix ci --- src/audit/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audit/README.md b/src/audit/README.md index f7f3629579..1baffb03e0 100644 --- a/src/audit/README.md +++ b/src/audit/README.md @@ -11,7 +11,7 @@ The official published results can be found in this file in the form of **active If you would like to re-generate **activevoteplans.json** yourself, via a live node and historical fragments - [*see here for instructions*](./balance/README.md) -If not, you can begin the audit with the following steps. +If not, you can begin the audit with the following steps *Example usage:* From 633d077d20ab60325cf791eabef6ba55c4db3ff3 Mon Sep 17 00:00:00 2001 From: kukkok3 <93382903+kukkok3@users.noreply.github.com> Date: Fri, 16 Feb 2024 15:36:40 +0100 Subject: [PATCH 03/20] cargo clippy and fix --- .../src/cryptography/zkps/correct_decryption/mod.rs | 2 +- .../zkps/correct_hybrid_decryption_key/mod.rs | 2 +- .../chain-vote/src/cryptography/zkps/mod.rs | 4 ++-- .../src/cryptography/zkps/unit_vector/messages.rs | 4 ++-- src/event-db/src/queries/event/ballot.rs | 3 +-- src/event-db/src/queries/event/mod.rs | 3 +-- src/event-db/src/queries/event/proposal.rs | 3 +-- src/event-db/src/queries/registration.rs | 12 ++++-------- src/event-db/src/queries/search.rs | 2 +- src/event-db/src/queries/vit_ss/fund.rs | 3 +-- src/jortestkit/src/load/stats.rs | 4 +--- src/jortestkit/src/measurement/benchmark/mod.rs | 2 +- src/voting-tools-rs/src/verification/verify.rs | 4 ++-- 13 files changed, 19 insertions(+), 29 deletions(-) diff --git a/src/chain-libs/chain-vote/src/cryptography/zkps/correct_decryption/mod.rs b/src/chain-libs/chain-vote/src/cryptography/zkps/correct_decryption/mod.rs index 738d4ce350..43e0b1b178 100644 --- a/src/chain-libs/chain-vote/src/cryptography/zkps/correct_decryption/mod.rs +++ b/src/chain-libs/chain-vote/src/cryptography/zkps/correct_decryption/mod.rs @@ -1,4 +1,4 @@ #[allow(dead_code)] mod zkp; -pub use zkp::Zkp as CorrectElGamalDecrZkp; + diff --git a/src/chain-libs/chain-vote/src/cryptography/zkps/correct_hybrid_decryption_key/mod.rs b/src/chain-libs/chain-vote/src/cryptography/zkps/correct_hybrid_decryption_key/mod.rs index 298bf98845..43e0b1b178 100644 --- a/src/chain-libs/chain-vote/src/cryptography/zkps/correct_hybrid_decryption_key/mod.rs +++ b/src/chain-libs/chain-vote/src/cryptography/zkps/correct_hybrid_decryption_key/mod.rs @@ -1,4 +1,4 @@ #[allow(dead_code)] mod zkp; -pub use zkp::Zkp as CorrectHybridDecrKeyZkp; + diff --git a/src/chain-libs/chain-vote/src/cryptography/zkps/mod.rs b/src/chain-libs/chain-vote/src/cryptography/zkps/mod.rs index d2a10b6e9e..d19d0034fa 100644 --- a/src/chain-libs/chain-vote/src/cryptography/zkps/mod.rs +++ b/src/chain-libs/chain-vote/src/cryptography/zkps/mod.rs @@ -4,7 +4,7 @@ mod correct_share_generation; mod dl_equality; mod unit_vector; -pub use correct_decryption::CorrectElGamalDecrZkp; -pub use correct_hybrid_decryption_key::CorrectHybridDecrKeyZkp; + + pub use correct_share_generation::CorrectShareGenerationZkp; pub use unit_vector::UnitVectorZkp; diff --git a/src/chain-libs/chain-vote/src/cryptography/zkps/unit_vector/messages.rs b/src/chain-libs/chain-vote/src/cryptography/zkps/unit_vector/messages.rs index 8e5f99d45e..9a0d8326b8 100644 --- a/src/chain-libs/chain-vote/src/cryptography/zkps/unit_vector/messages.rs +++ b/src/chain-libs/chain-vote/src/cryptography/zkps/unit_vector/messages.rs @@ -162,7 +162,7 @@ pub(crate) fn generate_polys( ); left_subtree .into_iter() - .chain(right_subtree.into_iter()) + .chain(right_subtree) .collect() } else { vec![parent.to_vec()] @@ -207,6 +207,6 @@ pub(crate) fn generate_polys( ); left_subtree .into_iter() - .chain(right_subtree.into_iter()) + .chain(right_subtree) .collect() } diff --git a/src/event-db/src/queries/event/ballot.rs b/src/event-db/src/queries/event/ballot.rs index 8a82e3c3ff..dec9441d55 100644 --- a/src/event-db/src/queries/event/ballot.rs +++ b/src/event-db/src/queries/event/ballot.rs @@ -79,8 +79,7 @@ impl BallotQueries for EventDB { &[&event.0, &objective.0, &proposal.0], ) .await?; - let row = rows - .get(0) + let row = rows.first() .ok_or_else(|| Error::NotFound("cat not find ballot value".to_string()))?; let choices = row.try_get("objective")?; diff --git a/src/event-db/src/queries/event/mod.rs b/src/event-db/src/queries/event/mod.rs index 1878b7666a..f6f36e5531 100644 --- a/src/event-db/src/queries/event/mod.rs +++ b/src/event-db/src/queries/event/mod.rs @@ -87,8 +87,7 @@ impl EventQueries for EventDB { let conn = self.pool.get().await?; let rows = conn.query(Self::EVENT_QUERY, &[&event.0]).await?; - let row = rows - .get(0) + let row = rows.first() .ok_or_else(|| Error::NotFound("can not find event value".to_string()))?; let ends = row diff --git a/src/event-db/src/queries/event/proposal.rs b/src/event-db/src/queries/event/proposal.rs index 50e9c7274f..e6eb22ccaa 100644 --- a/src/event-db/src/queries/event/proposal.rs +++ b/src/event-db/src/queries/event/proposal.rs @@ -60,8 +60,7 @@ impl ProposalQueries for EventDB { let rows = conn .query(Self::PROPOSAL_QUERY, &[&event.0, &objective.0, &proposal.0]) .await?; - let row = rows - .get(0) + let row = rows.first() .ok_or_else(|| Error::NotFound("cat not find proposal value".to_string()))?; let proposer = vec![ProposerDetails { diff --git a/src/event-db/src/queries/registration.rs b/src/event-db/src/queries/registration.rs index 7a782ad78e..624d241144 100644 --- a/src/event-db/src/queries/registration.rs +++ b/src/event-db/src/queries/registration.rs @@ -99,8 +99,7 @@ impl RegistrationQueries for EventDB { conn.query(Self::VOTER_BY_LAST_EVENT_QUERY, &[&voting_key]) .await? }; - let voter = rows - .get(0) + let voter = rows.first() .ok_or_else(|| Error::NotFound("can not find voter value".to_string()))?; let voting_group = VoterGroupId(voter.try_get("voting_group")?); @@ -117,8 +116,7 @@ impl RegistrationQueries for EventDB { .await? }; - let total_voting_power_per_group: i64 = rows - .get(0) + let total_voting_power_per_group: i64 = rows.first() .ok_or_else(|| { Error::NotFound("can not find total voting power per group value".to_string()) })? @@ -185,8 +183,7 @@ impl RegistrationQueries for EventDB { conn.query(Self::DELEGATOR_SNAPSHOT_INFO_BY_LAST_EVENT_QUERY, &[]) .await? }; - let delegator_snapshot_info = rows - .get(0) + let delegator_snapshot_info = rows.first() .ok_or_else(|| Error::NotFound("can not find delegator value".to_string()))?; let delegation_rows = if let Some(event) = event { @@ -226,8 +223,7 @@ impl RegistrationQueries for EventDB { conn.query(Self::TOTAL_POWER_BY_LAST_EVENT_QUERY, &[]) .await? }; - let total_power: i64 = rows - .get(0) + let total_power: i64 = rows.first() .ok_or_else(|| Error::NotFound("can not find total power value".to_string()))? .try_get("total_voting_power")?; diff --git a/src/event-db/src/queries/search.rs b/src/event-db/src/queries/search.rs index 7a12fde2d4..873fdde72a 100644 --- a/src/event-db/src/queries/search.rs +++ b/src/event-db/src/queries/search.rs @@ -146,7 +146,7 @@ impl SearchQueries for EventDB { ) .await .map_err(|e| Error::NotFound(e.to_string()))?; - let row = rows.get(0).unwrap(); + let row = rows.first().unwrap(); Ok(SearchResult { total: row.try_get("total")?, diff --git a/src/event-db/src/queries/vit_ss/fund.rs b/src/event-db/src/queries/vit_ss/fund.rs index 66d6370a3a..502338fbc5 100644 --- a/src/event-db/src/queries/vit_ss/fund.rs +++ b/src/event-db/src/queries/vit_ss/fund.rs @@ -118,8 +118,7 @@ impl VitSSFundQueries for EventDB { let conn = self.pool.get().await?; let rows = conn.query(Self::FUND_QUERY, &[]).await?; - let row = rows - .get(0) + let row = rows.first() .ok_or_else(|| Error::NotFound("can not find fund value".to_string()))?; let fund_id = row.try_get("id")?; diff --git a/src/jortestkit/src/load/stats.rs b/src/jortestkit/src/load/stats.rs index 09e6802339..c91dac85a9 100644 --- a/src/jortestkit/src/load/stats.rs +++ b/src/jortestkit/src/load/stats.rs @@ -95,9 +95,7 @@ impl Stats { pub fn errors(&self) -> Vec { self.requests - .iter() - .cloned() - .filter(|r| r.is_err()) + .iter().filter(|&r| r.is_err()).cloned() .map(|r| r.err().unwrap()) .collect() } diff --git a/src/jortestkit/src/measurement/benchmark/mod.rs b/src/jortestkit/src/measurement/benchmark/mod.rs index bb7600a3b6..640564f702 100644 --- a/src/jortestkit/src/measurement/benchmark/mod.rs +++ b/src/jortestkit/src/measurement/benchmark/mod.rs @@ -11,7 +11,7 @@ pub use endurance_benchmark::{ }; pub use consumption_benchmark::{ - ConsumptionBenchmarkDef, ConsumptionBenchmarkError, ConsumptionBenchmarkFinish, + ConsumptionBenchmarkDef, ConsumptionBenchmarkError, ConsumptionBenchmarkRun, }; diff --git a/src/voting-tools-rs/src/verification/verify.rs b/src/voting-tools-rs/src/verification/verify.rs index 3f88a894b7..00f73be7c4 100644 --- a/src/voting-tools-rs/src/verification/verify.rs +++ b/src/voting-tools-rs/src/verification/verify.rs @@ -120,7 +120,7 @@ pub fn filter_registrations( }; match reg.validate_signature_bin(rawreg.bin_reg.clone()) { - Ok(_) => (), + Ok(()) => (), Err(err) => { invalids.push(InvalidRegistration { spec_61284: Some(prefix_hex(&rawreg.bin_reg)), @@ -136,7 +136,7 @@ pub fn filter_registrations( } match reg.validate_multi_delegation(cip_36_multidelegations) { - Ok(_) => (), + Ok(()) => (), Err(err) => { invalids.push(InvalidRegistration { spec_61284: Some(prefix_hex(&rawreg.bin_reg)), From 84430ad9f1e1cab194811c71d23b6eba284e273c Mon Sep 17 00:00:00 2001 From: kukkok3 <93382903+kukkok3@users.noreply.github.com> Date: Fri, 16 Feb 2024 15:40:57 +0100 Subject: [PATCH 04/20] fix: fmt --- .../src/cryptography/zkps/correct_decryption/mod.rs | 2 -- .../zkps/correct_hybrid_decryption_key/mod.rs | 2 -- .../chain-vote/src/cryptography/zkps/mod.rs | 2 -- .../src/cryptography/zkps/unit_vector/messages.rs | 10 ++-------- src/event-db/src/queries/event/ballot.rs | 3 ++- src/event-db/src/queries/event/mod.rs | 3 ++- src/event-db/src/queries/event/proposal.rs | 3 ++- src/event-db/src/queries/registration.rs | 12 ++++++++---- src/event-db/src/queries/vit_ss/fund.rs | 3 ++- src/jortestkit/src/load/stats.rs | 4 +++- src/jortestkit/src/measurement/benchmark/mod.rs | 3 +-- .../src/tests/rest/search.rs | 12 ++++++++---- 12 files changed, 30 insertions(+), 29 deletions(-) diff --git a/src/chain-libs/chain-vote/src/cryptography/zkps/correct_decryption/mod.rs b/src/chain-libs/chain-vote/src/cryptography/zkps/correct_decryption/mod.rs index 43e0b1b178..2a9d6897fd 100644 --- a/src/chain-libs/chain-vote/src/cryptography/zkps/correct_decryption/mod.rs +++ b/src/chain-libs/chain-vote/src/cryptography/zkps/correct_decryption/mod.rs @@ -1,4 +1,2 @@ #[allow(dead_code)] mod zkp; - - diff --git a/src/chain-libs/chain-vote/src/cryptography/zkps/correct_hybrid_decryption_key/mod.rs b/src/chain-libs/chain-vote/src/cryptography/zkps/correct_hybrid_decryption_key/mod.rs index 43e0b1b178..2a9d6897fd 100644 --- a/src/chain-libs/chain-vote/src/cryptography/zkps/correct_hybrid_decryption_key/mod.rs +++ b/src/chain-libs/chain-vote/src/cryptography/zkps/correct_hybrid_decryption_key/mod.rs @@ -1,4 +1,2 @@ #[allow(dead_code)] mod zkp; - - diff --git a/src/chain-libs/chain-vote/src/cryptography/zkps/mod.rs b/src/chain-libs/chain-vote/src/cryptography/zkps/mod.rs index d19d0034fa..fd86bc2984 100644 --- a/src/chain-libs/chain-vote/src/cryptography/zkps/mod.rs +++ b/src/chain-libs/chain-vote/src/cryptography/zkps/mod.rs @@ -4,7 +4,5 @@ mod correct_share_generation; mod dl_equality; mod unit_vector; - - pub use correct_share_generation::CorrectShareGenerationZkp; pub use unit_vector::UnitVectorZkp; diff --git a/src/chain-libs/chain-vote/src/cryptography/zkps/unit_vector/messages.rs b/src/chain-libs/chain-vote/src/cryptography/zkps/unit_vector/messages.rs index 9a0d8326b8..82ec7c843e 100644 --- a/src/chain-libs/chain-vote/src/cryptography/zkps/unit_vector/messages.rs +++ b/src/chain-libs/chain-vote/src/cryptography/zkps/unit_vector/messages.rs @@ -160,10 +160,7 @@ pub(crate) fn generate_polys( next_level, params, ); - left_subtree - .into_iter() - .chain(right_subtree) - .collect() + left_subtree.into_iter().chain(right_subtree).collect() } else { vec![parent.to_vec()] } @@ -205,8 +202,5 @@ pub(crate) fn generate_polys( 1, &tp, ); - left_subtree - .into_iter() - .chain(right_subtree) - .collect() + left_subtree.into_iter().chain(right_subtree).collect() } diff --git a/src/event-db/src/queries/event/ballot.rs b/src/event-db/src/queries/event/ballot.rs index dec9441d55..6f8f294e72 100644 --- a/src/event-db/src/queries/event/ballot.rs +++ b/src/event-db/src/queries/event/ballot.rs @@ -79,7 +79,8 @@ impl BallotQueries for EventDB { &[&event.0, &objective.0, &proposal.0], ) .await?; - let row = rows.first() + let row = rows + .first() .ok_or_else(|| Error::NotFound("cat not find ballot value".to_string()))?; let choices = row.try_get("objective")?; diff --git a/src/event-db/src/queries/event/mod.rs b/src/event-db/src/queries/event/mod.rs index f6f36e5531..e92e0986de 100644 --- a/src/event-db/src/queries/event/mod.rs +++ b/src/event-db/src/queries/event/mod.rs @@ -87,7 +87,8 @@ impl EventQueries for EventDB { let conn = self.pool.get().await?; let rows = conn.query(Self::EVENT_QUERY, &[&event.0]).await?; - let row = rows.first() + let row = rows + .first() .ok_or_else(|| Error::NotFound("can not find event value".to_string()))?; let ends = row diff --git a/src/event-db/src/queries/event/proposal.rs b/src/event-db/src/queries/event/proposal.rs index e6eb22ccaa..4174655bb5 100644 --- a/src/event-db/src/queries/event/proposal.rs +++ b/src/event-db/src/queries/event/proposal.rs @@ -60,7 +60,8 @@ impl ProposalQueries for EventDB { let rows = conn .query(Self::PROPOSAL_QUERY, &[&event.0, &objective.0, &proposal.0]) .await?; - let row = rows.first() + let row = rows + .first() .ok_or_else(|| Error::NotFound("cat not find proposal value".to_string()))?; let proposer = vec![ProposerDetails { diff --git a/src/event-db/src/queries/registration.rs b/src/event-db/src/queries/registration.rs index 624d241144..47470b5a79 100644 --- a/src/event-db/src/queries/registration.rs +++ b/src/event-db/src/queries/registration.rs @@ -99,7 +99,8 @@ impl RegistrationQueries for EventDB { conn.query(Self::VOTER_BY_LAST_EVENT_QUERY, &[&voting_key]) .await? }; - let voter = rows.first() + let voter = rows + .first() .ok_or_else(|| Error::NotFound("can not find voter value".to_string()))?; let voting_group = VoterGroupId(voter.try_get("voting_group")?); @@ -116,7 +117,8 @@ impl RegistrationQueries for EventDB { .await? }; - let total_voting_power_per_group: i64 = rows.first() + let total_voting_power_per_group: i64 = rows + .first() .ok_or_else(|| { Error::NotFound("can not find total voting power per group value".to_string()) })? @@ -183,7 +185,8 @@ impl RegistrationQueries for EventDB { conn.query(Self::DELEGATOR_SNAPSHOT_INFO_BY_LAST_EVENT_QUERY, &[]) .await? }; - let delegator_snapshot_info = rows.first() + let delegator_snapshot_info = rows + .first() .ok_or_else(|| Error::NotFound("can not find delegator value".to_string()))?; let delegation_rows = if let Some(event) = event { @@ -223,7 +226,8 @@ impl RegistrationQueries for EventDB { conn.query(Self::TOTAL_POWER_BY_LAST_EVENT_QUERY, &[]) .await? }; - let total_power: i64 = rows.first() + let total_power: i64 = rows + .first() .ok_or_else(|| Error::NotFound("can not find total power value".to_string()))? .try_get("total_voting_power")?; diff --git a/src/event-db/src/queries/vit_ss/fund.rs b/src/event-db/src/queries/vit_ss/fund.rs index 502338fbc5..357c24e424 100644 --- a/src/event-db/src/queries/vit_ss/fund.rs +++ b/src/event-db/src/queries/vit_ss/fund.rs @@ -118,7 +118,8 @@ impl VitSSFundQueries for EventDB { let conn = self.pool.get().await?; let rows = conn.query(Self::FUND_QUERY, &[]).await?; - let row = rows.first() + let row = rows + .first() .ok_or_else(|| Error::NotFound("can not find fund value".to_string()))?; let fund_id = row.try_get("id")?; diff --git a/src/jortestkit/src/load/stats.rs b/src/jortestkit/src/load/stats.rs index c91dac85a9..9825f2c60a 100644 --- a/src/jortestkit/src/load/stats.rs +++ b/src/jortestkit/src/load/stats.rs @@ -95,7 +95,9 @@ impl Stats { pub fn errors(&self) -> Vec { self.requests - .iter().filter(|&r| r.is_err()).cloned() + .iter() + .filter(|&r| r.is_err()) + .cloned() .map(|r| r.err().unwrap()) .collect() } diff --git a/src/jortestkit/src/measurement/benchmark/mod.rs b/src/jortestkit/src/measurement/benchmark/mod.rs index 640564f702..2e5422e683 100644 --- a/src/jortestkit/src/measurement/benchmark/mod.rs +++ b/src/jortestkit/src/measurement/benchmark/mod.rs @@ -11,8 +11,7 @@ pub use endurance_benchmark::{ }; pub use consumption_benchmark::{ - ConsumptionBenchmarkDef, ConsumptionBenchmarkError, - ConsumptionBenchmarkRun, + ConsumptionBenchmarkDef, ConsumptionBenchmarkError, ConsumptionBenchmarkRun, }; pub use speed_benchmark::{SpeedBenchmarkDef, SpeedBenchmarkFinish, SpeedBenchmarkRun}; diff --git a/src/vit-servicing-station/vit-servicing-station-tests/src/tests/rest/search.rs b/src/vit-servicing-station/vit-servicing-station-tests/src/tests/rest/search.rs index 5769dad1b2..34b5e374fe 100644 --- a/src/vit-servicing-station/vit-servicing-station-tests/src/tests/rest/search.rs +++ b/src/vit-servicing-station/vit-servicing-station-tests/src/tests/rest/search.rs @@ -30,7 +30,9 @@ fn assert_response_contains_challenge( expected_challenge: &Challenge, search_response: SearchResponse, ) { - let SearchResponse::Challenge(challenges) = search_response else { panic!("internal error: querying for challenges but got proposals") }; + let SearchResponse::Challenge(challenges) = search_response else { + panic!("internal error: querying for challenges but got proposals") + }; assert!(challenges .iter() @@ -91,7 +93,9 @@ pub fn search_challenges_by_title_empty() { ) .unwrap(); - let SearchResponse::Challenge(challenges) = response else { panic!("internal error: querying for challenges but got proposals") }; + let SearchResponse::Challenge(challenges) = response else { + panic!("internal error: querying for challenges but got proposals") + }; assert!(challenges.is_empty()); } @@ -250,8 +254,8 @@ pub fn sort_challenges_result_by_title_desc() { ) .unwrap(); - let SearchResponse::Challenge(challenges) = response else { - panic!("internal error: querying for challenges but got proposals"); + let SearchResponse::Challenge(challenges) = response else { + panic!("internal error: querying for challenges but got proposals"); }; let mut expected: Vec<&String> = expected_challenges.iter().map(|x| &x.title).collect(); From 1c21c9cc3573f134f90e47618cf85e98d925c9aa Mon Sep 17 00:00:00 2001 From: kukkok3 <93382903+kukkok3@users.noreply.github.com> Date: Tue, 20 Feb 2024 17:19:22 +0100 Subject: [PATCH 05/20] feat: fix new cargo lint issues --- src/cat-data-service/src/types/event.rs | 1 + src/cat-data-service/src/types/registration.rs | 1 + src/cat-data-service/src/types/vit_ss/fund.rs | 1 + src/cat-data-service/src/types/vit_ss/vote_plan.rs | 1 + src/chain-libs/chain-crypto/src/lib.rs | 1 + src/jormungandr/jormungandr/src/network/client/mod.rs | 2 +- .../jormungandr-automation/src/jcli/command/votes/mod.rs | 2 +- .../jormungandr-automation/src/jormungandr/configuration/mod.rs | 1 - 8 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/cat-data-service/src/types/event.rs b/src/cat-data-service/src/types/event.rs index 727680d9cb..2a46f4c723 100644 --- a/src/cat-data-service/src/types/event.rs +++ b/src/cat-data-service/src/types/event.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] use super::{serialize_option_datetime_as_rfc3339, SerdeType}; use chrono::{DateTime, Utc}; use event_db::types::event::{ diff --git a/src/cat-data-service/src/types/registration.rs b/src/cat-data-service/src/types/registration.rs index c8a5863314..2073f955e0 100644 --- a/src/cat-data-service/src/types/registration.rs +++ b/src/cat-data-service/src/types/registration.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] use super::{serialize_datetime_as_rfc3339, SerdeType}; use chrono::{DateTime, Utc}; use event_db::types::registration::{ diff --git a/src/cat-data-service/src/types/vit_ss/fund.rs b/src/cat-data-service/src/types/vit_ss/fund.rs index d20bb000a4..522c2f8f06 100644 --- a/src/cat-data-service/src/types/vit_ss/fund.rs +++ b/src/cat-data-service/src/types/vit_ss/fund.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] use super::super::{serialize_datetime_as_rfc3339, SerdeType}; use chrono::{DateTime, Utc}; use event_db::types::vit_ss::{ diff --git a/src/cat-data-service/src/types/vit_ss/vote_plan.rs b/src/cat-data-service/src/types/vit_ss/vote_plan.rs index 84e99d70f4..5de1166ab0 100644 --- a/src/cat-data-service/src/types/vit_ss/vote_plan.rs +++ b/src/cat-data-service/src/types/vit_ss/vote_plan.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] use super::super::{serialize_datetime_as_rfc3339, SerdeType}; use chrono::{DateTime, Utc}; use event_db::types::vit_ss::vote_plan::Voteplan; diff --git a/src/chain-libs/chain-crypto/src/lib.rs b/src/chain-libs/chain-crypto/src/lib.rs index 47267a6ab5..0a77dc6290 100644 --- a/src/chain-libs/chain-crypto/src/lib.rs +++ b/src/chain-libs/chain-crypto/src/lib.rs @@ -13,6 +13,7 @@ mod kes; mod key; pub mod multilock; mod sign; +#[allow(hidden_glob_reexports)] mod vrf; pub mod role; diff --git a/src/jormungandr/jormungandr/src/network/client/mod.rs b/src/jormungandr/jormungandr/src/network/client/mod.rs index 5742b99380..be84665901 100644 --- a/src/jormungandr/jormungandr/src/network/client/mod.rs +++ b/src/jormungandr/jormungandr/src/network/client/mod.rs @@ -1,6 +1,6 @@ mod connect; -pub use self::connect::{connect, ConnectError, ConnectFuture, ConnectHandle}; +pub use self::connect::{connect, ConnectError, ConnectHandle}; use super::{ buffer_sizes, convert::{Decode, Encode}, diff --git a/src/jormungandr/testing/jormungandr-automation/src/jcli/command/votes/mod.rs b/src/jormungandr/testing/jormungandr-automation/src/jcli/command/votes/mod.rs index c1ea81db06..64f6515a02 100644 --- a/src/jormungandr/testing/jormungandr-automation/src/jcli/command/votes/mod.rs +++ b/src/jormungandr/testing/jormungandr-automation/src/jcli/command/votes/mod.rs @@ -9,7 +9,7 @@ mod tally; pub use committee::CommitteeCommand; pub use crs::CrsCommand; -pub use election_public_key::ElectionPublicKeyCommand; + pub use tally::TallyCommand; #[derive(Debug)] diff --git a/src/jormungandr/testing/jormungandr-automation/src/jormungandr/configuration/mod.rs b/src/jormungandr/testing/jormungandr-automation/src/jormungandr/configuration/mod.rs index 882c603ed8..cc595fc36f 100644 --- a/src/jormungandr/testing/jormungandr-automation/src/jormungandr/configuration/mod.rs +++ b/src/jormungandr/testing/jormungandr-automation/src/jormungandr/configuration/mod.rs @@ -13,7 +13,6 @@ mod secret; pub use block0::Block0ConfigurationBuilder; pub use jormungandr_config::EitherHashOrBlock0; pub use node::{NodeConfigBuilder, NodeConfigManager}; -pub use secret::{NodeSecretExtension, SecretModelFactory}; lazy_static! { static ref NEXT_AVAILABLE_PORT_NUMBER: AtomicU16 = AtomicU16::new(10000); From d3cac191f92588be67d61f31e1c9d76000b57e92 Mon Sep 17 00:00:00 2001 From: kukkok3 <93382903+kukkok3@users.noreply.github.com> Date: Wed, 21 Feb 2024 09:58:53 +0100 Subject: [PATCH 06/20] fix: issues caused by new cargo version --- .../src/jormungandr/configuration/mod.rs | 2 +- .../jormungandr-automation/src/jormungandr/legacy/mod.rs | 3 --- .../testing/jormungandr-automation/src/jormungandr/mod.rs | 2 +- .../jormungandr-automation/src/jormungandr/starter/mod.rs | 2 +- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/jormungandr/testing/jormungandr-automation/src/jormungandr/configuration/mod.rs b/src/jormungandr/testing/jormungandr-automation/src/jormungandr/configuration/mod.rs index cc595fc36f..09799ee0ac 100644 --- a/src/jormungandr/testing/jormungandr-automation/src/jormungandr/configuration/mod.rs +++ b/src/jormungandr/testing/jormungandr-automation/src/jormungandr/configuration/mod.rs @@ -8,7 +8,7 @@ use std::{ mod block0; mod jormungandr_config; mod node; -mod secret; +pub mod secret; pub use block0::Block0ConfigurationBuilder; pub use jormungandr_config::EitherHashOrBlock0; diff --git a/src/jormungandr/testing/jormungandr-automation/src/jormungandr/legacy/mod.rs b/src/jormungandr/testing/jormungandr-automation/src/jormungandr/legacy/mod.rs index cd3be9be35..2e634830f1 100644 --- a/src/jormungandr/testing/jormungandr-automation/src/jormungandr/legacy/mod.rs +++ b/src/jormungandr/testing/jormungandr-automation/src/jormungandr/legacy/mod.rs @@ -8,9 +8,6 @@ pub use config::{ LegacyConfigError, LegacyNodeConfig, LegacyNodeConfigBuilder, LegacyNodeConfigConverter, LegacyNodeConfigManager, }; -pub use jormungandr_lib::interfaces::{ - Log, Mempool, NodeConfig, P2p, Policy, Rest, TopicsOfInterest, TrustedPeer, -}; use jortestkit::file; pub use rest::BackwardCompatibleRest; use std::path::PathBuf; diff --git a/src/jormungandr/testing/jormungandr-automation/src/jormungandr/mod.rs b/src/jormungandr/testing/jormungandr-automation/src/jormungandr/mod.rs index f3ea2f0090..9ca69fd460 100644 --- a/src/jormungandr/testing/jormungandr-automation/src/jormungandr/mod.rs +++ b/src/jormungandr/testing/jormungandr-automation/src/jormungandr/mod.rs @@ -16,7 +16,7 @@ pub mod grpc; pub use self::{ configuration::{ get_available_port, Block0ConfigurationBuilder, EitherHashOrBlock0, NodeConfigBuilder, - NodeConfigManager, SecretModelFactory, + NodeConfigManager, secret::SecretModelFactory, }, explorer::{ compare_schema as compare_explorer_schema, Explorer, ExplorerError, ExplorerProcess, diff --git a/src/jormungandr/testing/jormungandr-automation/src/jormungandr/starter/mod.rs b/src/jormungandr/testing/jormungandr-automation/src/jormungandr/starter/mod.rs index 93face58b3..cabbbc1d03 100644 --- a/src/jormungandr/testing/jormungandr-automation/src/jormungandr/starter/mod.rs +++ b/src/jormungandr/testing/jormungandr-automation/src/jormungandr/starter/mod.rs @@ -1,7 +1,7 @@ #![allow(dead_code)] mod commands; -pub use commands::{get_command, CommandBuilder}; +pub use commands::get_command; mod params; mod testing_directory; From 113ce98d93f254e02179e54f24518346985d1667 Mon Sep 17 00:00:00 2001 From: kukkok3 <93382903+kukkok3@users.noreply.github.com> Date: Wed, 21 Feb 2024 10:00:21 +0100 Subject: [PATCH 07/20] cargo fix --- src/jormungandr/testing/hersir/src/config/blockchain/mod.rs | 2 +- .../testing/hersir/src/controller/monitor/node/legacy.rs | 2 +- .../testing/hersir/src/controller/monitor/node/mod.rs | 3 +-- .../mainnet-lib/src/network/wallet_state/template/mod.rs | 4 ++-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/jormungandr/testing/hersir/src/config/blockchain/mod.rs b/src/jormungandr/testing/hersir/src/config/blockchain/mod.rs index eb0e4e4150..77c67775dd 100644 --- a/src/jormungandr/testing/hersir/src/config/blockchain/mod.rs +++ b/src/jormungandr/testing/hersir/src/config/blockchain/mod.rs @@ -1,5 +1,5 @@ mod configuration; -pub use chain_impl_mockchain::chaintypes::ConsensusVersion; + pub use configuration::{BlockchainBuilder, BlockchainConfiguration}; use jormungandr_lib::crypto::hash::Hash; use serde::Deserialize; diff --git a/src/jormungandr/testing/hersir/src/controller/monitor/node/legacy.rs b/src/jormungandr/testing/hersir/src/controller/monitor/node/legacy.rs index c37d636f7e..6287b2916c 100644 --- a/src/jormungandr/testing/hersir/src/controller/monitor/node/legacy.rs +++ b/src/jormungandr/testing/hersir/src/controller/monitor/node/legacy.rs @@ -7,7 +7,7 @@ use chain_impl_mockchain::{ header::HeaderId, }; pub use jormungandr_automation::jormungandr::{ - grpc::JormungandrClient, BackwardCompatibleRest, FragmentNode, FragmentNodeError, + BackwardCompatibleRest, FragmentNode, FragmentNodeError, JormungandrLogger, JormungandrProcess, JormungandrRest, MemPoolCheck, StartupVerificationMode, Status, }; diff --git a/src/jormungandr/testing/hersir/src/controller/monitor/node/mod.rs b/src/jormungandr/testing/hersir/src/controller/monitor/node/mod.rs index 430eed1fc1..22cba42d43 100644 --- a/src/jormungandr/testing/hersir/src/controller/monitor/node/mod.rs +++ b/src/jormungandr/testing/hersir/src/controller/monitor/node/mod.rs @@ -7,8 +7,7 @@ use chain_core::property::Fragment as _; use chain_impl_mockchain::fragment::{Fragment, FragmentId}; use indicatif::ProgressBar; pub use jormungandr_automation::jormungandr::{ - grpc::{client::MockClientError, JormungandrClient}, - uri_from_socket_addr, FragmentNode, FragmentNodeError, JormungandrLogger, JormungandrRest, + grpc::{client::MockClientError, JormungandrClient}, FragmentNode, FragmentNodeError, JormungandrLogger, JormungandrRest, MemPoolCheck, RestError, }; use jormungandr_automation::{ diff --git a/src/vit-testing/mainnet-lib/src/network/wallet_state/template/mod.rs b/src/vit-testing/mainnet-lib/src/network/wallet_state/template/mod.rs index 7523191e3f..dc72735c95 100644 --- a/src/vit-testing/mainnet-lib/src/network/wallet_state/template/mod.rs +++ b/src/vit-testing/mainnet-lib/src/network/wallet_state/template/mod.rs @@ -4,8 +4,8 @@ mod external_providers; use super::MainnetWalletState; use crate::CardanoWallet; -pub use actor::{delegator, registration, representative, Actor}; -pub use arbitrary::{generate_arbitrary_delegator, Error as ArbitraryError}; +pub use actor::{Actor}; +pub use arbitrary::{generate_arbitrary_delegator}; use chain_crypto::PublicKeyFromStrError; pub use external_providers::{DummyExternalProvider, ExternalProvider}; use jormungandr_lib::crypto::account::Identifier; From 72cfb80dad3426aac7cd37cbe444456fc18d26db Mon Sep 17 00:00:00 2001 From: kukkok3 <93382903+kukkok3@users.noreply.github.com> Date: Wed, 21 Feb 2024 10:05:05 +0100 Subject: [PATCH 08/20] cargo fix --- .../mjolnir/src/mjolnir_lib/fragment/batch/adversary/mod.rs | 2 +- .../testing/mjolnir/src/mjolnir_lib/fragment/batch/mod.rs | 2 +- .../src/mjolnir_lib/fragment/standard/adversary/mod.rs | 2 +- .../mjolnir/src/mjolnir_lib/fragment/standard/mod.rs | 6 +++--- src/vit-testing/valgrind/src/data.rs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/jormungandr/testing/mjolnir/src/mjolnir_lib/fragment/batch/adversary/mod.rs b/src/jormungandr/testing/mjolnir/src/mjolnir_lib/fragment/batch/adversary/mod.rs index 273e503f2b..85c0a79a79 100644 --- a/src/jormungandr/testing/mjolnir/src/mjolnir_lib/fragment/batch/adversary/mod.rs +++ b/src/jormungandr/testing/mjolnir/src/mjolnir_lib/fragment/batch/adversary/mod.rs @@ -3,7 +3,7 @@ mod votes_only; use crate::mjolnir_lib::MjolnirError; use clap::Parser; -pub use votes_only::VotesOnly; + #[derive(Parser, Debug)] pub enum Adversary { VotesOnly(votes_only::VotesOnly), diff --git a/src/jormungandr/testing/mjolnir/src/mjolnir_lib/fragment/batch/mod.rs b/src/jormungandr/testing/mjolnir/src/mjolnir_lib/fragment/batch/mod.rs index 445f72390a..7f6850f9d4 100644 --- a/src/jormungandr/testing/mjolnir/src/mjolnir_lib/fragment/batch/mod.rs +++ b/src/jormungandr/testing/mjolnir/src/mjolnir_lib/fragment/batch/mod.rs @@ -3,7 +3,7 @@ mod tx_only; use crate::mjolnir_lib::MjolnirError; use clap::Parser; -pub use tx_only::TxOnly; + #[derive(Parser, Debug)] pub enum Batch { /// Prints nodes related data, like stats,fragments etc. diff --git a/src/jormungandr/testing/mjolnir/src/mjolnir_lib/fragment/standard/adversary/mod.rs b/src/jormungandr/testing/mjolnir/src/mjolnir_lib/fragment/standard/adversary/mod.rs index 162ba28017..c0462bcc86 100644 --- a/src/jormungandr/testing/mjolnir/src/mjolnir_lib/fragment/standard/adversary/mod.rs +++ b/src/jormungandr/testing/mjolnir/src/mjolnir_lib/fragment/standard/adversary/mod.rs @@ -3,7 +3,7 @@ mod votes_only; use crate::mjolnir_lib::MjolnirError; use clap::Parser; -pub use votes_only::VotesOnly; + #[derive(Parser, Debug)] pub enum Adversary { diff --git a/src/jormungandr/testing/mjolnir/src/mjolnir_lib/fragment/standard/mod.rs b/src/jormungandr/testing/mjolnir/src/mjolnir_lib/fragment/standard/mod.rs index 614f1effb5..b87c8ccc82 100644 --- a/src/jormungandr/testing/mjolnir/src/mjolnir_lib/fragment/standard/mod.rs +++ b/src/jormungandr/testing/mjolnir/src/mjolnir_lib/fragment/standard/mod.rs @@ -3,10 +3,10 @@ mod all; mod tx_only; use crate::mjolnir_lib::MjolnirError; -pub use adversary::Adversary; -pub use all::AllFragments; + + use clap::Parser; -pub use tx_only::TxOnly; + #[derive(Parser, Debug)] pub enum Standard { /// Put load on endpoint using transaction fragments only. diff --git a/src/vit-testing/valgrind/src/data.rs b/src/vit-testing/valgrind/src/data.rs index 03e6f40625..41f4b8d4a4 100644 --- a/src/vit-testing/valgrind/src/data.rs +++ b/src/vit-testing/valgrind/src/data.rs @@ -8,7 +8,7 @@ pub use vit_servicing_station_lib::{ db::models::funds::Fund, db::models::proposals::Proposal, v0::endpoints::service_version::ServiceVersion as VitVersion, }; -pub use wallet_core::{Choice, Value}; + pub trait ProposalExtension { fn chain_proposal_id_as_str(&self) -> String; From 1e3f42924c54b6520ba52140b83ed6ae7db3825d Mon Sep 17 00:00:00 2001 From: kukkok3 <93382903+kukkok3@users.noreply.github.com> Date: Wed, 21 Feb 2024 10:08:43 +0100 Subject: [PATCH 09/20] cargo fmt --- .../testing/hersir/src/controller/monitor/node/legacy.rs | 5 ++--- .../testing/hersir/src/controller/monitor/node/mod.rs | 4 ++-- .../testing/jormungandr-automation/src/jormungandr/mod.rs | 4 ++-- .../src/mjolnir_lib/fragment/standard/adversary/mod.rs | 1 - .../testing/mjolnir/src/mjolnir_lib/fragment/standard/mod.rs | 1 - .../mainnet-lib/src/network/wallet_state/template/mod.rs | 4 ++-- src/vit-testing/valgrind/src/data.rs | 1 - 7 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/jormungandr/testing/hersir/src/controller/monitor/node/legacy.rs b/src/jormungandr/testing/hersir/src/controller/monitor/node/legacy.rs index 6287b2916c..e3968e0b63 100644 --- a/src/jormungandr/testing/hersir/src/controller/monitor/node/legacy.rs +++ b/src/jormungandr/testing/hersir/src/controller/monitor/node/legacy.rs @@ -7,9 +7,8 @@ use chain_impl_mockchain::{ header::HeaderId, }; pub use jormungandr_automation::jormungandr::{ - BackwardCompatibleRest, FragmentNode, FragmentNodeError, - JormungandrLogger, JormungandrProcess, JormungandrRest, MemPoolCheck, StartupVerificationMode, - Status, + BackwardCompatibleRest, FragmentNode, FragmentNodeError, JormungandrLogger, JormungandrProcess, + JormungandrRest, MemPoolCheck, StartupVerificationMode, Status, }; use jormungandr_automation::{ jormungandr::{LogLevel, NodeAlias, StartupError}, diff --git a/src/jormungandr/testing/hersir/src/controller/monitor/node/mod.rs b/src/jormungandr/testing/hersir/src/controller/monitor/node/mod.rs index 22cba42d43..7550921268 100644 --- a/src/jormungandr/testing/hersir/src/controller/monitor/node/mod.rs +++ b/src/jormungandr/testing/hersir/src/controller/monitor/node/mod.rs @@ -7,8 +7,8 @@ use chain_core::property::Fragment as _; use chain_impl_mockchain::fragment::{Fragment, FragmentId}; use indicatif::ProgressBar; pub use jormungandr_automation::jormungandr::{ - grpc::{client::MockClientError, JormungandrClient}, FragmentNode, FragmentNodeError, JormungandrLogger, JormungandrRest, - MemPoolCheck, RestError, + grpc::{client::MockClientError, JormungandrClient}, + FragmentNode, FragmentNodeError, JormungandrLogger, JormungandrRest, MemPoolCheck, RestError, }; use jormungandr_automation::{ jormungandr::{ diff --git a/src/jormungandr/testing/jormungandr-automation/src/jormungandr/mod.rs b/src/jormungandr/testing/jormungandr-automation/src/jormungandr/mod.rs index 9ca69fd460..52bb3bcea2 100644 --- a/src/jormungandr/testing/jormungandr-automation/src/jormungandr/mod.rs +++ b/src/jormungandr/testing/jormungandr-automation/src/jormungandr/mod.rs @@ -15,8 +15,8 @@ pub mod grpc; pub use self::{ configuration::{ - get_available_port, Block0ConfigurationBuilder, EitherHashOrBlock0, NodeConfigBuilder, - NodeConfigManager, secret::SecretModelFactory, + get_available_port, secret::SecretModelFactory, Block0ConfigurationBuilder, + EitherHashOrBlock0, NodeConfigBuilder, NodeConfigManager, }, explorer::{ compare_schema as compare_explorer_schema, Explorer, ExplorerError, ExplorerProcess, diff --git a/src/jormungandr/testing/mjolnir/src/mjolnir_lib/fragment/standard/adversary/mod.rs b/src/jormungandr/testing/mjolnir/src/mjolnir_lib/fragment/standard/adversary/mod.rs index c0462bcc86..b8930d16e4 100644 --- a/src/jormungandr/testing/mjolnir/src/mjolnir_lib/fragment/standard/adversary/mod.rs +++ b/src/jormungandr/testing/mjolnir/src/mjolnir_lib/fragment/standard/adversary/mod.rs @@ -4,7 +4,6 @@ mod votes_only; use crate::mjolnir_lib::MjolnirError; use clap::Parser; - #[derive(Parser, Debug)] pub enum Adversary { VotesOnly(votes_only::VotesOnly), diff --git a/src/jormungandr/testing/mjolnir/src/mjolnir_lib/fragment/standard/mod.rs b/src/jormungandr/testing/mjolnir/src/mjolnir_lib/fragment/standard/mod.rs index b87c8ccc82..b70a54fd13 100644 --- a/src/jormungandr/testing/mjolnir/src/mjolnir_lib/fragment/standard/mod.rs +++ b/src/jormungandr/testing/mjolnir/src/mjolnir_lib/fragment/standard/mod.rs @@ -4,7 +4,6 @@ mod tx_only; use crate::mjolnir_lib::MjolnirError; - use clap::Parser; #[derive(Parser, Debug)] diff --git a/src/vit-testing/mainnet-lib/src/network/wallet_state/template/mod.rs b/src/vit-testing/mainnet-lib/src/network/wallet_state/template/mod.rs index dc72735c95..6920afb8bc 100644 --- a/src/vit-testing/mainnet-lib/src/network/wallet_state/template/mod.rs +++ b/src/vit-testing/mainnet-lib/src/network/wallet_state/template/mod.rs @@ -4,8 +4,8 @@ mod external_providers; use super::MainnetWalletState; use crate::CardanoWallet; -pub use actor::{Actor}; -pub use arbitrary::{generate_arbitrary_delegator}; +pub use actor::Actor; +pub use arbitrary::generate_arbitrary_delegator; use chain_crypto::PublicKeyFromStrError; pub use external_providers::{DummyExternalProvider, ExternalProvider}; use jormungandr_lib::crypto::account::Identifier; diff --git a/src/vit-testing/valgrind/src/data.rs b/src/vit-testing/valgrind/src/data.rs index 41f4b8d4a4..8c1a137d89 100644 --- a/src/vit-testing/valgrind/src/data.rs +++ b/src/vit-testing/valgrind/src/data.rs @@ -9,7 +9,6 @@ pub use vit_servicing_station_lib::{ v0::endpoints::service_version::ServiceVersion as VitVersion, }; - pub trait ProposalExtension { fn chain_proposal_id_as_str(&self) -> String; fn into_wallet_proposal(self) -> wallet_core::Proposal; From 93d1ff4d467db92dce9a76674e1a591be236cf0e Mon Sep 17 00:00:00 2001 From: kukkok3 <93382903+kukkok3@users.noreply.github.com> Date: Wed, 21 Feb 2024 10:20:40 +0100 Subject: [PATCH 10/20] fix: remove unused import --- src/jormungandr/testing/thor/src/fragment/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jormungandr/testing/thor/src/fragment/mod.rs b/src/jormungandr/testing/thor/src/fragment/mod.rs index 236eadd8b9..c104ec79f1 100644 --- a/src/jormungandr/testing/thor/src/fragment/mod.rs +++ b/src/jormungandr/testing/thor/src/fragment/mod.rs @@ -4,7 +4,7 @@ pub use self::{ initial_certificates::{signed_delegation_cert, signed_stake_pool_cert, vote_plan_cert}, persistent_log::{write_into_persistent_log, PersistentLogViewer}, sender::{BlockDateGenerator, FragmentSender, FragmentSenderError}, - setup::{DummySyncNode, FragmentSenderSetup, FragmentSenderSetupBuilder, VerifyStrategy}, + setup::{DummySyncNode, FragmentSenderSetup, FragmentSenderSetupBuilder}, verifier::{ExitStrategy as VerifyExitStrategy, FragmentVerifier, FragmentVerifierError}, }; use crate::{ From 34303113d0810babb2522b2686feebfcc13f7ddd Mon Sep 17 00:00:00 2001 From: kukkok3 <93382903+kukkok3@users.noreply.github.com> Date: Wed, 21 Feb 2024 10:36:21 +0100 Subject: [PATCH 11/20] fix linting --- src/chain-libs/chain-crypto/src/digest.rs | 2 +- src/chain-libs/chain-crypto/src/key.rs | 2 +- src/chain-libs/chain-crypto/src/role.rs | 2 +- .../chain-impl-mockchain/src/testing/builders/vote.rs | 2 +- src/jortestkit/src/measurement/marker/resources_usage.rs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/chain-libs/chain-crypto/src/digest.rs b/src/chain-libs/chain-crypto/src/digest.rs index 0f5378f42e..82b24f4bde 100644 --- a/src/chain-libs/chain-crypto/src/digest.rs +++ b/src/chain-libs/chain-crypto/src/digest.rs @@ -306,7 +306,7 @@ impl PartialEq for DigestOf { } impl Eq for DigestOf {} - +#[allow(clippy::non_canonical_partial_ord_impl)] impl PartialOrd for DigestOf { fn partial_cmp(&self, other: &Self) -> Option { self.inner.partial_cmp(&other.inner) diff --git a/src/chain-libs/chain-crypto/src/key.rs b/src/chain-libs/chain-crypto/src/key.rs index 70fe79180b..f90382bcf0 100644 --- a/src/chain-libs/chain-crypto/src/key.rs +++ b/src/chain-libs/chain-crypto/src/key.rs @@ -232,7 +232,7 @@ impl std::cmp::PartialEq for PublicKey { } impl std::cmp::Eq for PublicKey {} - +#[allow(clippy::non_canonical_partial_ord_impl)] impl std::cmp::PartialOrd for PublicKey { fn partial_cmp(&self, other: &Self) -> Option { self.0.as_ref().partial_cmp(other.0.as_ref()) diff --git a/src/chain-libs/chain-crypto/src/role.rs b/src/chain-libs/chain-crypto/src/role.rs index 207b2df5f8..a4c53d382a 100644 --- a/src/chain-libs/chain-crypto/src/role.rs +++ b/src/chain-libs/chain-crypto/src/role.rs @@ -72,7 +72,7 @@ impl std::cmp::PartialEq for PublicKey std::cmp::Eq for PublicKey {} - +#[allow(clippy::non_canonical_partial_ord_impl)] impl std::cmp::PartialOrd for PublicKey { fn partial_cmp(&self, other: &Self) -> Option { self.inner.partial_cmp(&other.inner) diff --git a/src/chain-libs/chain-impl-mockchain/src/testing/builders/vote.rs b/src/chain-libs/chain-impl-mockchain/src/testing/builders/vote.rs index 324f3c38ec..2750fdbfbe 100644 --- a/src/chain-libs/chain-impl-mockchain/src/testing/builders/vote.rs +++ b/src/chain-libs/chain-impl-mockchain/src/testing/builders/vote.rs @@ -42,7 +42,7 @@ pub fn decrypt_tally( let proposals = shares .into_iter() - .zip(tallies.into_iter()) + .zip(tallies) .map(|(shares, tally)| DecryptedPrivateTallyProposal { decrypt_shares: shares.into_boxed_slice(), tally_result: tally.votes.into_boxed_slice(), diff --git a/src/jortestkit/src/measurement/marker/resources_usage.rs b/src/jortestkit/src/measurement/marker/resources_usage.rs index 64c780c8dc..d1b348faae 100644 --- a/src/jortestkit/src/measurement/marker/resources_usage.rs +++ b/src/jortestkit/src/measurement/marker/resources_usage.rs @@ -17,7 +17,7 @@ impl PartialEq for ResourcesUsage { && self.virtual_memory_usage == other.virtual_memory_usage } } - +#[allow(clippy::non_canonical_partial_ord_impl)] impl PartialOrd for ResourcesUsage { fn partial_cmp(&self, other: &Self) -> Option { let cpu_cmp = self.cpu_usage().partial_cmp(&other.cpu_usage()).unwrap(); From 69b594e9ebde39b5d8de51ee0192f35b9d2c4b6e Mon Sep 17 00:00:00 2001 From: kukkok3 <93382903+kukkok3@users.noreply.github.com> Date: Wed, 21 Feb 2024 11:07:16 +0100 Subject: [PATCH 12/20] fix linting --- src/chain-libs/chain-impl-mockchain/src/multiverse.rs | 2 +- .../src/testing/arbitrary/address.rs | 11 ++++------- .../src/testing/arbitrary/ledger_builder.rs | 2 +- .../src/testing/arbitrary/transaction.rs | 9 +++------ .../chain-impl-mockchain/src/tokens/minting_policy.rs | 2 +- src/chain-libs/chain-impl-mockchain/src/value.rs | 2 +- 6 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/chain-libs/chain-impl-mockchain/src/multiverse.rs b/src/chain-libs/chain-impl-mockchain/src/multiverse.rs index 1abf72afca..82d30fdc03 100644 --- a/src/chain-libs/chain-impl-mockchain/src/multiverse.rs +++ b/src/chain-libs/chain-impl-mockchain/src/multiverse.rs @@ -110,7 +110,7 @@ impl Multiverse { pub fn insert(&mut self, chain_length: ChainLength, k: HeaderId, st: State) -> Ref { self.states_by_chain_length .entry(chain_length) - .or_insert_with(HashSet::new) + .or_default() .insert(k); let state = Arc::new(st); self.states_by_hash diff --git a/src/chain-libs/chain-impl-mockchain/src/testing/arbitrary/address.rs b/src/chain-libs/chain-impl-mockchain/src/testing/arbitrary/address.rs index 7ae7cba9f3..7ba72c21c6 100644 --- a/src/chain-libs/chain-impl-mockchain/src/testing/arbitrary/address.rs +++ b/src/chain-libs/chain-impl-mockchain/src/testing/arbitrary/address.rs @@ -106,23 +106,20 @@ impl ArbitraryAddressDataValueVec { pub fn utxos(&self) -> Vec { self.0 .iter() - .cloned() - .filter(|x| matches!(x.address_data.kind(), Kind::Single { .. })) + .filter(|&x| matches!(x.address_data.kind(), Kind::Single { .. })).cloned() .collect() } pub fn accounts(&self) -> Vec { self.0 .iter() - .cloned() - .filter(|x| matches!(x.address_data.kind(), Kind::Account { .. })) + .filter(|&x| matches!(x.address_data.kind(), Kind::Account { .. })).cloned() .collect() } pub fn delegations(&self) -> Vec { self.0 .iter() - .cloned() - .filter(|x| matches!(x.address_data.kind(), Kind::Group { .. })) - .collect() + .filter(|&x| matches!(x.address_data.kind(), Kind::Group { .. })) + .cloned().collect() } } diff --git a/src/chain-libs/chain-impl-mockchain/src/testing/arbitrary/ledger_builder.rs b/src/chain-libs/chain-impl-mockchain/src/testing/arbitrary/ledger_builder.rs index 957d064db5..80a442a749 100644 --- a/src/chain-libs/chain-impl-mockchain/src/testing/arbitrary/ledger_builder.rs +++ b/src/chain-libs/chain-impl-mockchain/src/testing/arbitrary/ledger_builder.rs @@ -23,7 +23,7 @@ impl Arbitrary for LedgerBuilder { let faucets = WalletCollection::arbitrary(g); let splits = utils::split_vec(&faucets.0, g, 3); - let stake_pools_owners = splits.get(0).unwrap(); + let stake_pools_owners = splits.first().unwrap(); let stake_pools: Vec = stake_pools_owners .iter() .cloned() diff --git a/src/chain-libs/chain-impl-mockchain/src/testing/arbitrary/transaction.rs b/src/chain-libs/chain-impl-mockchain/src/testing/arbitrary/transaction.rs index 1845f0a14b..badaf7b838 100644 --- a/src/chain-libs/chain-impl-mockchain/src/testing/arbitrary/transaction.rs +++ b/src/chain-libs/chain-impl-mockchain/src/testing/arbitrary/transaction.rs @@ -190,8 +190,7 @@ impl AccountStatesVerifier { .0 .addresses .iter() - .cloned() - .filter(filter_accounts) + .filter(|&x| filter_accounts(x)).cloned() .map(|x| find_equal_and_sub(x, inputs)) .collect(); @@ -232,8 +231,7 @@ impl AccountStatesVerifier { fn find_equal_and_sub(x: AddressDataValue, collection: &[AddressDataValue]) -> AddressDataValue { match collection .iter() - .cloned() - .find(|y| y.address_data == x.address_data) + .find(|&y| y.address_data == x.address_data).cloned() { Some(y) => AddressDataValue::new(x.address_data, (x.value - y.value).unwrap()), None => x, @@ -243,8 +241,7 @@ fn find_equal_and_sub(x: AddressDataValue, collection: &[AddressDataValue]) -> A fn find_equal_and_add(x: AddressDataValue, collection: &[AddressDataValue]) -> AddressDataValue { match collection .iter() - .cloned() - .find(|y| y.address_data == x.address_data) + .find(|&y| y.address_data == x.address_data).cloned() { Some(y) => AddressDataValue::new(x.address_data, (x.value + y.value).unwrap()), None => x, diff --git a/src/chain-libs/chain-impl-mockchain/src/tokens/minting_policy.rs b/src/chain-libs/chain-impl-mockchain/src/tokens/minting_policy.rs index 5e2725358c..07209f1d20 100644 --- a/src/chain-libs/chain-impl-mockchain/src/tokens/minting_policy.rs +++ b/src/chain-libs/chain-impl-mockchain/src/tokens/minting_policy.rs @@ -49,7 +49,7 @@ impl MintingPolicy { if self.0.is_empty() { return Err(MintingPolicyViolation::AdditionalMintingNotAllowed); } - + #[allow(clippy::never_loop)] for _entry in &self.0 { unreachable!("implement this when we have actual minting policies"); } diff --git a/src/chain-libs/chain-impl-mockchain/src/value.rs b/src/chain-libs/chain-impl-mockchain/src/value.rs index d57a3ec253..456386bdbb 100644 --- a/src/chain-libs/chain-impl-mockchain/src/value.rs +++ b/src/chain-libs/chain-impl-mockchain/src/value.rs @@ -31,7 +31,7 @@ impl Value { where I: Iterator, { - values.fold(Ok(Value::zero()), |acc, v| acc? + v) + values.try_fold(Value::zero(), |acc, v| acc? + v) } #[inline] From 79a38d250c21d09eccc47c81c393d875d63ab6c4 Mon Sep 17 00:00:00 2001 From: kukkok3 <93382903+kukkok3@users.noreply.github.com> Date: Wed, 21 Feb 2024 11:33:31 +0100 Subject: [PATCH 13/20] fix: more linting --- .../src/rewards/proposers/mod.rs | 1 + .../src/testing/arbitrary/address.rs | 9 ++++++--- .../src/testing/arbitrary/transaction.rs | 20 ++++++++++++------- .../src/testing/arbitrary/utils.rs | 2 +- .../src/testing/builders/tx_builder.rs | 4 ++-- .../src/testing/gen/mod.rs | 2 +- .../src/testing/scenario/controller.rs | 6 +++--- .../src/testing/scenario/scenario_builder.rs | 6 +++--- .../chain-impl-mockchain/src/value.rs | 4 ++-- src/event-db/src/queries/event/mod.rs | 1 + src/event-db/src/queries/registration.rs | 1 + src/event-db/src/queries/search.rs | 1 + src/event-db/src/queries/vit_ss/fund.rs | 3 ++- src/vit-testing/iapyx/src/load/config/mod.rs | 1 - src/vit-testing/iapyx/src/load/mod.rs | 1 - .../src/network/wallet_state/template/mod.rs | 2 +- .../src/cardano_cli/wrapper/mod.rs | 2 +- 17 files changed, 39 insertions(+), 27 deletions(-) diff --git a/src/catalyst-toolbox/catalyst-toolbox/src/rewards/proposers/mod.rs b/src/catalyst-toolbox/catalyst-toolbox/src/rewards/proposers/mod.rs index e45a017289..10e218e9e8 100644 --- a/src/catalyst-toolbox/catalyst-toolbox/src/rewards/proposers/mod.rs +++ b/src/catalyst-toolbox/catalyst-toolbox/src/rewards/proposers/mod.rs @@ -1,3 +1,4 @@ +#[allow(hidden_glob_reexports)] use self::{io::vecs_to_maps, types::NotFundedReason}; use crate::types::{challenge::Challenge, proposal::Proposal}; use chain_impl_mockchain::value::Value; diff --git a/src/chain-libs/chain-impl-mockchain/src/testing/arbitrary/address.rs b/src/chain-libs/chain-impl-mockchain/src/testing/arbitrary/address.rs index 7ba72c21c6..333affabac 100644 --- a/src/chain-libs/chain-impl-mockchain/src/testing/arbitrary/address.rs +++ b/src/chain-libs/chain-impl-mockchain/src/testing/arbitrary/address.rs @@ -106,13 +106,15 @@ impl ArbitraryAddressDataValueVec { pub fn utxos(&self) -> Vec { self.0 .iter() - .filter(|&x| matches!(x.address_data.kind(), Kind::Single { .. })).cloned() + .filter(|&x| matches!(x.address_data.kind(), Kind::Single { .. })) + .cloned() .collect() } pub fn accounts(&self) -> Vec { self.0 .iter() - .filter(|&x| matches!(x.address_data.kind(), Kind::Account { .. })).cloned() + .filter(|&x| matches!(x.address_data.kind(), Kind::Account { .. })) + .cloned() .collect() } @@ -120,6 +122,7 @@ impl ArbitraryAddressDataValueVec { self.0 .iter() .filter(|&x| matches!(x.address_data.kind(), Kind::Group { .. })) - .cloned().collect() + .cloned() + .collect() } } diff --git a/src/chain-libs/chain-impl-mockchain/src/testing/arbitrary/transaction.rs b/src/chain-libs/chain-impl-mockchain/src/testing/arbitrary/transaction.rs index badaf7b838..73ab324d40 100644 --- a/src/chain-libs/chain-impl-mockchain/src/testing/arbitrary/transaction.rs +++ b/src/chain-libs/chain-impl-mockchain/src/testing/arbitrary/transaction.rs @@ -190,7 +190,8 @@ impl AccountStatesVerifier { .0 .addresses .iter() - .filter(|&x| filter_accounts(x)).cloned() + .filter(|&x| filter_accounts(x)) + .cloned() .map(|x| find_equal_and_sub(x, inputs)) .collect(); @@ -231,7 +232,8 @@ impl AccountStatesVerifier { fn find_equal_and_sub(x: AddressDataValue, collection: &[AddressDataValue]) -> AddressDataValue { match collection .iter() - .find(|&y| y.address_data == x.address_data).cloned() + .find(|&y| y.address_data == x.address_data) + .cloned() { Some(y) => AddressDataValue::new(x.address_data, (x.value - y.value).unwrap()), None => x, @@ -241,7 +243,8 @@ fn find_equal_and_sub(x: AddressDataValue, collection: &[AddressDataValue]) -> A fn find_equal_and_add(x: AddressDataValue, collection: &[AddressDataValue]) -> AddressDataValue { match collection .iter() - .find(|&y| y.address_data == x.address_data).cloned() + .find(|&y| y.address_data == x.address_data) + .cloned() { Some(y) => AddressDataValue::new(x.address_data, (x.value + y.value).unwrap()), None => x, @@ -265,7 +268,7 @@ impl UtxoVerifier { pub fn new(transaction_data: ArbitraryValidTransactionData) -> Self { UtxoVerifier(transaction_data) } - + #[allow(clippy::iter_overeager_cloned)] pub fn calculate_current_utxo(&self) -> Vec { let inputs = &self.0.input_addresses; let all = &self.0.addresses; @@ -273,12 +276,15 @@ impl UtxoVerifier { let utxo_not_changed: Vec = all .iter() + .filter(|&x| filter_utxo(x)) .cloned() - .filter(filter_utxo) .filter(|x| !inputs.contains(x)) .collect(); - let utxo_added: Vec = - outputs.iter().cloned().filter(filter_utxo).collect(); + let utxo_added: Vec = outputs + .iter() + .filter(|&x| filter_utxo(x)) + .cloned() + .collect(); let mut snapshot = Vec::new(); snapshot.extend(utxo_not_changed); diff --git a/src/chain-libs/chain-impl-mockchain/src/testing/arbitrary/utils.rs b/src/chain-libs/chain-impl-mockchain/src/testing/arbitrary/utils.rs index d4c9f359a4..e3eaa7761c 100644 --- a/src/chain-libs/chain-impl-mockchain/src/testing/arbitrary/utils.rs +++ b/src/chain-libs/chain-impl-mockchain/src/testing/arbitrary/utils.rs @@ -139,8 +139,8 @@ impl Verify { pub fn get_result(&self) -> TestResult { self.0 .iter() + .find(|&x| TestResult::is_failure(x)) .cloned() - .find(TestResult::is_failure) .unwrap_or_else(TestResult::passed) } } diff --git a/src/chain-libs/chain-impl-mockchain/src/testing/builders/tx_builder.rs b/src/chain-libs/chain-impl-mockchain/src/testing/builders/tx_builder.rs index 3eaa4282aa..a76174744d 100644 --- a/src/chain-libs/chain-impl-mockchain/src/testing/builders/tx_builder.rs +++ b/src/chain-libs/chain-impl-mockchain/src/testing/builders/tx_builder.rs @@ -85,7 +85,7 @@ impl TestTxBuilder { ); let mut faucet = test_ledger .faucets - .get(0) + .first() .cloned() .as_mut() .expect("test ledger with no faucet configured") @@ -126,7 +126,7 @@ impl TestTxBuilder { ); let mut faucet = test_ledger .faucets - .get(0) + .first() .as_mut() .expect("test ledger with no faucet configured") .clone(); diff --git a/src/chain-libs/chain-impl-mockchain/src/testing/gen/mod.rs b/src/chain-libs/chain-impl-mockchain/src/testing/gen/mod.rs index 031e24bf8a..81853d7fb1 100644 --- a/src/chain-libs/chain-impl-mockchain/src/testing/gen/mod.rs +++ b/src/chain-libs/chain-impl-mockchain/src/testing/gen/mod.rs @@ -211,7 +211,7 @@ impl TestGen { rng.fill_bytes(&mut policy_hash); TokenIdentifier { - policy_hash: TryFrom::try_from(policy_hash).unwrap(), + policy_hash: From::from(policy_hash), token_name: Self::token_name(), } } diff --git a/src/chain-libs/chain-impl-mockchain/src/testing/scenario/controller.rs b/src/chain-libs/chain-impl-mockchain/src/testing/scenario/controller.rs index 11bed05390..bb920489d4 100644 --- a/src/chain-libs/chain-impl-mockchain/src/testing/scenario/controller.rs +++ b/src/chain-libs/chain-impl-mockchain/src/testing/scenario/controller.rs @@ -71,8 +71,8 @@ impl Controller { pub fn wallet(&self, alias: &str) -> Result { self.declared_wallets .iter() + .find(|&x| x.alias() == alias) .cloned() - .find(|x| x.alias() == alias) .ok_or(ControllerError::UnknownWallet { alias: alias.to_owned(), }) @@ -81,8 +81,8 @@ impl Controller { pub fn vote_plan(&self, alias: &str) -> Result { self.declared_vote_plans .iter() + .find(|&x| x.alias() == alias) .cloned() - .find(|x| x.alias() == alias) .ok_or(ControllerError::UnknownVotePlan { alias: alias.to_owned(), }) @@ -95,8 +95,8 @@ impl Controller { pub fn stake_pool(&self, alias: &str) -> Result { self.declared_stake_pools .iter() + .find(|&x| x.alias() == alias) .cloned() - .find(|x| x.alias() == alias) .ok_or(ControllerError::UnknownStakePool { alias: alias.to_owned(), }) diff --git a/src/chain-libs/chain-impl-mockchain/src/testing/scenario/scenario_builder.rs b/src/chain-libs/chain-impl-mockchain/src/testing/scenario/scenario_builder.rs index bae13f5c3f..993460cb9e 100644 --- a/src/chain-libs/chain-impl-mockchain/src/testing/scenario/scenario_builder.rs +++ b/src/chain-libs/chain-impl-mockchain/src/testing/scenario/scenario_builder.rs @@ -113,8 +113,8 @@ impl ScenarioBuilder { let vote_plan_def = x.build(); let owner = wallets .iter() + .find(|&w| w.alias() == vote_plan_def.owner()) .cloned() - .find(|w| w.alias() == vote_plan_def.owner()) .expect("cannot find wallet for vote plan"); let vote_plan: VotePlan = vote_plan_def.into(); create_initial_vote_plan(&vote_plan, &[owner]) @@ -162,8 +162,8 @@ impl ScenarioBuilder { .map(|pk| { wallets .iter() + .find(|&x| x.public_key() == pk) .cloned() - .find(|x| x.public_key() == pk) .expect("unknown key") }) .collect(); @@ -180,8 +180,8 @@ impl ScenarioBuilder { ) -> Vec { initials .iter() + .filter(|&x| x.delegates_stake_pool().is_some()) .cloned() - .filter(|x| x.delegates_stake_pool().is_some()) .map(|wallet_template| { let stake_pool_alias = wallet_template.delegates_stake_pool().unwrap(); let stake_pool = stake_pools diff --git a/src/chain-libs/chain-impl-mockchain/src/value.rs b/src/chain-libs/chain-impl-mockchain/src/value.rs index 456386bdbb..bf4736ede5 100644 --- a/src/chain-libs/chain-impl-mockchain/src/value.rs +++ b/src/chain-libs/chain-impl-mockchain/src/value.rs @@ -21,7 +21,7 @@ pub struct SplitValueIn { pub parts: Value, pub remaining: Value, } - +#[allow(clippy::manual_try_fold)] impl Value { pub fn zero() -> Self { Value(0) @@ -31,7 +31,7 @@ impl Value { where I: Iterator, { - values.try_fold(Value::zero(), |acc, v| acc? + v) + values.fold(Ok(Value::zero()), |acc, v| acc? + v) } #[inline] diff --git a/src/event-db/src/queries/event/mod.rs b/src/event-db/src/queries/event/mod.rs index e92e0986de..125cd30239 100644 --- a/src/event-db/src/queries/event/mod.rs +++ b/src/event-db/src/queries/event/mod.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] use crate::{ error::Error, types::event::{ diff --git a/src/event-db/src/queries/registration.rs b/src/event-db/src/queries/registration.rs index 47470b5a79..d5f8894975 100644 --- a/src/event-db/src/queries/registration.rs +++ b/src/event-db/src/queries/registration.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] use crate::{ types::{ event::EventId, diff --git a/src/event-db/src/queries/search.rs b/src/event-db/src/queries/search.rs index 873fdde72a..3204e5a1d7 100644 --- a/src/event-db/src/queries/search.rs +++ b/src/event-db/src/queries/search.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] use crate::{ types::{ search::{ diff --git a/src/event-db/src/queries/vit_ss/fund.rs b/src/event-db/src/queries/vit_ss/fund.rs index 357c24e424..188126f705 100644 --- a/src/event-db/src/queries/vit_ss/fund.rs +++ b/src/event-db/src/queries/vit_ss/fund.rs @@ -1,3 +1,4 @@ +#![allow(deprecated)] use crate::{ types::vit_ss::{ challenge::{Challenge, ChallengeHighlights}, @@ -60,7 +61,7 @@ impl EventDB { next_fund.voting_start AS next_voting_start, next_fund.voting_end AS next_voting_end, next_fund.tallying_end AS next_tallying_end - + FROM event this_fund LEFT JOIN event next_fund ON next_fund.row_id = this_fund.row_id + 1 WHERE this_fund.end_time > CURRENT_TIMESTAMP AT TIME ZONE 'UTC' AND this_fund.start_time < CURRENT_TIMESTAMP AT TIME ZONE 'UTC' diff --git a/src/vit-testing/iapyx/src/load/config/mod.rs b/src/vit-testing/iapyx/src/load/config/mod.rs index a68a9bae39..29ff392115 100644 --- a/src/vit-testing/iapyx/src/load/config/mod.rs +++ b/src/vit-testing/iapyx/src/load/config/mod.rs @@ -5,7 +5,6 @@ mod servicing_station; pub use artificial_user::{ Config as ArtificialUserLoadConfig, RequestType as ArtificialUserRequestType, }; -pub use node::{Config as NodeLoadConfig, Error as NodeLoadConfigError}; pub use servicing_station::{ Config as ServicingStationLoadConfig, Error as ServicingStationConfigError, RequestType as ServicingStationRequestType, diff --git a/src/vit-testing/iapyx/src/load/mod.rs b/src/vit-testing/iapyx/src/load/mod.rs index 4a0f2ecc11..1f7219037b 100644 --- a/src/vit-testing/iapyx/src/load/mod.rs +++ b/src/vit-testing/iapyx/src/load/mod.rs @@ -4,7 +4,6 @@ mod request_generators; mod scenario; mod status_provider; -pub use config::{ArtificialUserLoadConfig, NodeLoadConfig}; pub use multi_controller::{MultiController, MultiControllerError}; pub use request_generators::{ServicingStationRequestGen, WalletRequestGen}; pub use scenario::*; diff --git a/src/vit-testing/mainnet-lib/src/network/wallet_state/template/mod.rs b/src/vit-testing/mainnet-lib/src/network/wallet_state/template/mod.rs index 6920afb8bc..2f6ee6687e 100644 --- a/src/vit-testing/mainnet-lib/src/network/wallet_state/template/mod.rs +++ b/src/vit-testing/mainnet-lib/src/network/wallet_state/template/mod.rs @@ -104,7 +104,7 @@ pub enum Error { #[cfg(test)] mod tests { use crate::network::wallet_state::template::{ - build_default, delegator, registration, representative, + actor::delegator, actor::registration, actor::representative, build_default, }; use crate::{Block0, BlockBuilder, Ledger, Settings}; use cardano_serialization_lib::Transaction; diff --git a/src/vit-testing/mainnet-tools/src/cardano_cli/wrapper/mod.rs b/src/vit-testing/mainnet-tools/src/cardano_cli/wrapper/mod.rs index d30e14c48f..b39b157ddf 100644 --- a/src/vit-testing/mainnet-tools/src/cardano_cli/wrapper/mod.rs +++ b/src/vit-testing/mainnet-tools/src/cardano_cli/wrapper/mod.rs @@ -4,5 +4,5 @@ mod error; pub mod utils; pub use cli::Api; -pub use data::CardanoKeyTemplate; + pub use error::Error; From d88bdbf01899854d7a856c259b4d17be4e0696c7 Mon Sep 17 00:00:00 2001 From: kukkok3 <93382903+kukkok3@users.noreply.github.com> Date: Wed, 21 Feb 2024 11:38:28 +0100 Subject: [PATCH 14/20] fix: more linting --- src/jormungandr/jormungandr-lib/src/crypto/key.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jormungandr/jormungandr-lib/src/crypto/key.rs b/src/jormungandr/jormungandr-lib/src/crypto/key.rs index 3993288af0..603e988ce9 100644 --- a/src/jormungandr/jormungandr-lib/src/crypto/key.rs +++ b/src/jormungandr/jormungandr-lib/src/crypto/key.rs @@ -460,7 +460,7 @@ impl Eq for Signature {} impl PartialOrd> for Identifier { fn partial_cmp(&self, other: &Self) -> Option { - self.0.partial_cmp(&other.0) + Some(self.cmp(other)) } } From c327bebb7dacbe6eba22e7427291843568fc5b86 Mon Sep 17 00:00:00 2001 From: kukkok3 <93382903+kukkok3@users.noreply.github.com> Date: Wed, 21 Feb 2024 12:52:48 +0100 Subject: [PATCH 15/20] fix: lints --- src/vit-testing/iapyx/src/lib.rs | 3 ++- src/vit-testing/iapyx/src/load/mod.rs | 2 +- src/vit-testing/iapyx/src/load/scenario/node.rs | 2 +- src/vit-testing/vitup/src/builders/helpers/mod.rs | 4 ++-- src/vit-testing/vitup/src/builders/helpers/vote_plan.rs | 1 - src/vit-testing/vitup/src/builders/mod.rs | 6 +++--- src/vit-testing/vitup/src/cli/generate/data/mod.rs | 2 +- src/vit-testing/vitup/src/cli/start/quick.rs | 1 - src/vit-testing/vitup/src/config/builder.rs | 6 +----- src/vit-testing/vitup/src/mode/standard/controllers/main.rs | 6 +++--- src/vit-testing/vitup/src/mode/standard/controllers/mod.rs | 4 ++-- .../vitup/src/mode/standard/controllers/vit_station/mod.rs | 3 +-- 12 files changed, 17 insertions(+), 23 deletions(-) diff --git a/src/vit-testing/iapyx/src/lib.rs b/src/vit-testing/iapyx/src/lib.rs index ca4607fefc..b01b65f4cb 100644 --- a/src/vit-testing/iapyx/src/lib.rs +++ b/src/vit-testing/iapyx/src/lib.rs @@ -24,9 +24,10 @@ mod exports { }; pub use crate::load::{ ArtificialUserLoad, ArtificialUserLoadError, MultiController, MultiControllerError, - NodeLoad, NodeLoadConfig, NodeLoadError, ServicingStationLoad, ServicingStationLoadError, + NodeLoad, NodeLoadError, ServicingStationLoad, ServicingStationLoadError, VoteStatusProvider, WalletRequestGen, }; + pub use crate::utils::{expiry, qr}; pub use crate::wallet::{Error as WalletError, Wallet}; } diff --git a/src/vit-testing/iapyx/src/load/mod.rs b/src/vit-testing/iapyx/src/load/mod.rs index 1f7219037b..2de310eff5 100644 --- a/src/vit-testing/iapyx/src/load/mod.rs +++ b/src/vit-testing/iapyx/src/load/mod.rs @@ -1,4 +1,4 @@ -mod config; +pub mod config; mod multi_controller; mod request_generators; mod scenario; diff --git a/src/vit-testing/iapyx/src/load/scenario/node.rs b/src/vit-testing/iapyx/src/load/scenario/node.rs index 75d7ccf717..18d4a33eba 100644 --- a/src/vit-testing/iapyx/src/load/scenario/node.rs +++ b/src/vit-testing/iapyx/src/load/scenario/node.rs @@ -2,7 +2,7 @@ use crate::load::multi_controller::MultiControllerError; use crate::load::request_generators::RequestGenError; use crate::load::request_generators::{BatchWalletRequestGen, WalletRequestGen}; use crate::load::status_provider::VoteStatusProvider; -use crate::load::NodeLoadConfig; +use crate::NodeLoadConfig; use crate::NodeLoadError; use jortestkit::measurement::EfficiencyBenchmarkFinish; use thiserror::Error; diff --git a/src/vit-testing/vitup/src/builders/helpers/mod.rs b/src/vit-testing/vitup/src/builders/helpers/mod.rs index f359d46f1b..1b2dbc0341 100644 --- a/src/vit-testing/vitup/src/builders/helpers/mod.rs +++ b/src/vit-testing/vitup/src/builders/helpers/mod.rs @@ -1,8 +1,8 @@ mod archive; -mod qr; +pub mod qr; mod static_data; mod time; -mod vote_plan; +pub mod vote_plan; pub use self::time::{convert_to_blockchain_date, convert_to_human_date}; pub use archive::{ diff --git a/src/vit-testing/vitup/src/builders/helpers/vote_plan.rs b/src/vit-testing/vitup/src/builders/helpers/vote_plan.rs index 4cc6262914..95baca98dc 100644 --- a/src/vit-testing/vitup/src/builders/helpers/vote_plan.rs +++ b/src/vit-testing/vitup/src/builders/helpers/vote_plan.rs @@ -4,7 +4,6 @@ use chain_impl_mockchain::testing::scenario::template::ProposalDefBuilder; use chain_impl_mockchain::testing::TestGen; use hersir::builder::VotePlanKey; use hersir::config::{CommitteeTemplate, PrivateParameters, VotePlanTemplate}; -pub use jormungandr_lib::interfaces::Initial; use jormungandr_lib::interfaces::{BlockDate, TokenIdentifier}; use std::iter; diff --git a/src/vit-testing/vitup/src/builders/mod.rs b/src/vit-testing/vitup/src/builders/mod.rs index 1bee475d92..831fe63ce5 100644 --- a/src/vit-testing/vitup/src/builders/mod.rs +++ b/src/vit-testing/vitup/src/builders/mod.rs @@ -1,7 +1,8 @@ -mod helpers; +pub mod helpers; mod reviews; pub mod utils; +use crate::builders::helpers::VitVotePlanDefBuilder; pub use crate::builders::helpers::{build_current_fund, build_servicing_station_parameters}; use crate::builders::utils::DeploymentTree; use crate::config; @@ -17,14 +18,13 @@ use config::Block0Initial::Wallet; pub use helpers::{ convert_to_blockchain_date, convert_to_human_date, discover_archive_input_files, generate_qr_and_hashes, get_configuration_from_file_url, ArchiveConfError, - ArchiveConfiguration, VitVotePlanDefBuilder, WalletExtension, + ArchiveConfiguration, }; use hersir::builder::settings::Blockchain; use hersir::builder::Node; use hersir::builder::Topology; use hersir::config::{CommitteeTemplate, ExplorerTemplate, SessionSettings, WalletTemplate}; use jormungandr_automation::jormungandr::PersistenceMode; -pub use jormungandr_lib::interfaces::Initial; use jormungandr_lib::interfaces::NumberOfSlotsPerEpoch; use jormungandr_lib::interfaces::SlotDuration; use jormungandr_lib::interfaces::TokenIdentifier as TokenIdentifierLib; diff --git a/src/vit-testing/vitup/src/cli/generate/data/mod.rs b/src/vit-testing/vitup/src/cli/generate/data/mod.rs index b5d3dce9e9..e23d3d248e 100644 --- a/src/vit-testing/vitup/src/cli/generate/data/mod.rs +++ b/src/vit-testing/vitup/src/cli/generate/data/mod.rs @@ -4,7 +4,7 @@ mod random; use crate::Result; pub use external::ExternalDataCommandArgs; -pub use jormungandr_lib::interfaces::Initial; + pub use perf::PerfDataCommandArgs; pub use random::{ AllRandomDataCommandArgs, RandomReviewsDataCommandArgs, RandomScoresDataCommandArgs, diff --git a/src/vit-testing/vitup/src/cli/start/quick.rs b/src/vit-testing/vitup/src/cli/start/quick.rs index b54d422144..e39face6d9 100644 --- a/src/vit-testing/vitup/src/cli/start/quick.rs +++ b/src/vit-testing/vitup/src/cli/start/quick.rs @@ -1,5 +1,4 @@ use crate::builders::utils::logger; -pub use crate::builders::{VitBackendSettingsBuilder, FOLLOWER, LEADER_1, LEADER_2, LEADER_3}; use crate::config::read_voter_hirs; use crate::config::ConfigBuilder; use crate::config::{ diff --git a/src/vit-testing/vitup/src/config/builder.rs b/src/vit-testing/vitup/src/config/builder.rs index d05e516cc6..594791bf48 100644 --- a/src/vit-testing/vitup/src/config/builder.rs +++ b/src/vit-testing/vitup/src/config/builder.rs @@ -1,8 +1,4 @@ -pub use crate::builders::ReviewGenerator; -pub use crate::builders::{ - convert_to_blockchain_date, convert_to_human_date, generate_qr_and_hashes, - VitVotePlanDefBuilder, WalletExtension, -}; +pub use crate::builders::convert_to_human_date; use crate::config::Block0Initials; use crate::config::{date_format, Initials}; use crate::config::{Config, VoteTime}; diff --git a/src/vit-testing/vitup/src/mode/standard/controllers/main.rs b/src/vit-testing/vitup/src/mode/standard/controllers/main.rs index 9bc3cf4cd4..9daefb5310 100644 --- a/src/vit-testing/vitup/src/mode/standard/controllers/main.rs +++ b/src/vit-testing/vitup/src/mode/standard/controllers/main.rs @@ -1,9 +1,9 @@ use super::{ super::VitSettings, vit_station::{ - dump_settings_to_file, BootstrapCommandBuilder, DbGenerator, - Error as VitStationControllerError, RestClient, ValidVotePlanParameters, - ValidVotingTemplateGenerator, VitStationController, VIT_CONFIG, + controller::VitStationController, controller::VIT_CONFIG, dump_settings_to_file, + BootstrapCommandBuilder, DbGenerator, Error as VitStationControllerError, RestClient, + ValidVotePlanParameters, ValidVotingTemplateGenerator, }, wallet_proxy::{Error as WalletProxyError, WalletProxyController, WalletProxySpawnParams}, }; diff --git a/src/vit-testing/vitup/src/mode/standard/controllers/mod.rs b/src/vit-testing/vitup/src/mode/standard/controllers/mod.rs index 85b8e47e70..1535307566 100644 --- a/src/vit-testing/vitup/src/mode/standard/controllers/mod.rs +++ b/src/vit-testing/vitup/src/mode/standard/controllers/mod.rs @@ -1,12 +1,12 @@ mod explorer; mod main; -mod vit_station; +pub mod vit_station; mod wallet_proxy; pub use vit_station::{ + controller::VitStationController, controller::VitStationSettings, controller::VIT_CONFIG, generate_database, generate_random_database, DataError, DbGenerator, Error as VitStationControllerError, ValidVotePlanParameters, ValidVotingTemplateGenerator, - VitStationController, VitStationSettings, }; pub use wallet_proxy::{ diff --git a/src/vit-testing/vitup/src/mode/standard/controllers/vit_station/mod.rs b/src/vit-testing/vitup/src/mode/standard/controllers/vit_station/mod.rs index 602bcca415..0d8128c7db 100644 --- a/src/vit-testing/vitup/src/mode/standard/controllers/vit_station/mod.rs +++ b/src/vit-testing/vitup/src/mode/standard/controllers/vit_station/mod.rs @@ -1,4 +1,4 @@ -mod controller; +pub mod controller; mod data; pub use vit_servicing_station_tests::common::{ @@ -12,7 +12,6 @@ pub use vit_servicing_station_tests::common::{ pub use vit_servicing_station_lib::server::settings::dump_settings_to_file; -pub use controller::{VitStationController, VitStationSettings, VIT_CONFIG, VIT_STATION_LOG}; pub use data::{generate_database, generate_random_database, DbGenerator, Error as DataError}; use std::time::Duration; pub type Result = std::result::Result; From fe8388fd02e7ddc0846b051b0cf765d654d5a55e Mon Sep 17 00:00:00 2001 From: kukkok3 <93382903+kukkok3@users.noreply.github.com> Date: Wed, 21 Feb 2024 13:11:38 +0100 Subject: [PATCH 16/20] fix: lint --- src/vit-testing/iapyx/src/load/scenario/artificial_users.rs | 3 --- src/vit-testing/iapyx/src/load/scenario/node.rs | 3 --- 2 files changed, 6 deletions(-) diff --git a/src/vit-testing/iapyx/src/load/scenario/artificial_users.rs b/src/vit-testing/iapyx/src/load/scenario/artificial_users.rs index 3efc3927cc..c2d4272eb3 100644 --- a/src/vit-testing/iapyx/src/load/scenario/artificial_users.rs +++ b/src/vit-testing/iapyx/src/load/scenario/artificial_users.rs @@ -119,9 +119,6 @@ impl ArtificialUserLoad { /// Generator errors #[derive(Error, Debug)] pub enum Error { - /// Loading configuration - #[error("configuration error")] - LoadConfig(#[from] crate::load::config::NodeLoadConfigError), /// Building configuration #[error("configuration error")] ServicingConfig(#[from] crate::load::config::ServicingStationConfigError), diff --git a/src/vit-testing/iapyx/src/load/scenario/node.rs b/src/vit-testing/iapyx/src/load/scenario/node.rs index 18d4a33eba..4f8acc9660 100644 --- a/src/vit-testing/iapyx/src/load/scenario/node.rs +++ b/src/vit-testing/iapyx/src/load/scenario/node.rs @@ -75,9 +75,6 @@ impl NodeLoad { /// Errors for node load #[derive(Error, Debug)] pub enum Error { - /// Configuration error - #[error("config error")] - ConfigError(#[from] crate::load::config::NodeLoadConfigError), /// Controller errors #[error("internal error")] MultiControllerError(#[from] MultiControllerError), From 4721fbb721c9265841477f80ffd335da15f444bc Mon Sep 17 00:00:00 2001 From: kukkok3 <93382903+kukkok3@users.noreply.github.com> Date: Wed, 21 Feb 2024 13:28:18 +0100 Subject: [PATCH 17/20] fix --- src/vit-testing/iapyx/src/load/config/mod.rs | 1 + src/vit-testing/iapyx/src/load/scenario/artificial_users.rs | 3 +++ src/vit-testing/iapyx/src/load/scenario/node.rs | 3 +++ 3 files changed, 7 insertions(+) diff --git a/src/vit-testing/iapyx/src/load/config/mod.rs b/src/vit-testing/iapyx/src/load/config/mod.rs index 29ff392115..a68a9bae39 100644 --- a/src/vit-testing/iapyx/src/load/config/mod.rs +++ b/src/vit-testing/iapyx/src/load/config/mod.rs @@ -5,6 +5,7 @@ mod servicing_station; pub use artificial_user::{ Config as ArtificialUserLoadConfig, RequestType as ArtificialUserRequestType, }; +pub use node::{Config as NodeLoadConfig, Error as NodeLoadConfigError}; pub use servicing_station::{ Config as ServicingStationLoadConfig, Error as ServicingStationConfigError, RequestType as ServicingStationRequestType, diff --git a/src/vit-testing/iapyx/src/load/scenario/artificial_users.rs b/src/vit-testing/iapyx/src/load/scenario/artificial_users.rs index c2d4272eb3..3efc3927cc 100644 --- a/src/vit-testing/iapyx/src/load/scenario/artificial_users.rs +++ b/src/vit-testing/iapyx/src/load/scenario/artificial_users.rs @@ -119,6 +119,9 @@ impl ArtificialUserLoad { /// Generator errors #[derive(Error, Debug)] pub enum Error { + /// Loading configuration + #[error("configuration error")] + LoadConfig(#[from] crate::load::config::NodeLoadConfigError), /// Building configuration #[error("configuration error")] ServicingConfig(#[from] crate::load::config::ServicingStationConfigError), diff --git a/src/vit-testing/iapyx/src/load/scenario/node.rs b/src/vit-testing/iapyx/src/load/scenario/node.rs index 4f8acc9660..18d4a33eba 100644 --- a/src/vit-testing/iapyx/src/load/scenario/node.rs +++ b/src/vit-testing/iapyx/src/load/scenario/node.rs @@ -75,6 +75,9 @@ impl NodeLoad { /// Errors for node load #[derive(Error, Debug)] pub enum Error { + /// Configuration error + #[error("config error")] + ConfigError(#[from] crate::load::config::NodeLoadConfigError), /// Controller errors #[error("internal error")] MultiControllerError(#[from] MultiControllerError), From 17f563fff0fafacac23473ab3fc24bd3ccf61c5d Mon Sep 17 00:00:00 2001 From: kukkok3 <93382903+kukkok3@users.noreply.github.com> Date: Wed, 21 Feb 2024 14:22:26 +0100 Subject: [PATCH 18/20] fix: lints --- src/vit-testing/iapyx/src/load/config/artificial_user.rs | 2 +- src/vit-testing/iapyx/src/load/scenario/node.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vit-testing/iapyx/src/load/config/artificial_user.rs b/src/vit-testing/iapyx/src/load/config/artificial_user.rs index 94f401d06f..1553d7d34a 100644 --- a/src/vit-testing/iapyx/src/load/config/artificial_user.rs +++ b/src/vit-testing/iapyx/src/load/config/artificial_user.rs @@ -1,4 +1,4 @@ -use crate::NodeLoadConfig; +use crate::load::config::NodeLoadConfig; use jortestkit::load::Configuration; use serde::{Deserialize, Serialize}; diff --git a/src/vit-testing/iapyx/src/load/scenario/node.rs b/src/vit-testing/iapyx/src/load/scenario/node.rs index 18d4a33eba..a7d5d52b87 100644 --- a/src/vit-testing/iapyx/src/load/scenario/node.rs +++ b/src/vit-testing/iapyx/src/load/scenario/node.rs @@ -1,8 +1,8 @@ +use crate::load::config::NodeLoadConfig; use crate::load::multi_controller::MultiControllerError; use crate::load::request_generators::RequestGenError; use crate::load::request_generators::{BatchWalletRequestGen, WalletRequestGen}; use crate::load::status_provider::VoteStatusProvider; -use crate::NodeLoadConfig; use crate::NodeLoadError; use jortestkit::measurement::EfficiencyBenchmarkFinish; use thiserror::Error; From 5ccf1c6a7740948064e259fc856f52d5c10f9842 Mon Sep 17 00:00:00 2001 From: kukkok3 <93382903+kukkok3@users.noreply.github.com> Date: Wed, 21 Feb 2024 14:33:40 +0100 Subject: [PATCH 19/20] fix: lints --- src/catalyst-toolbox/snapshot-lib/src/registration.rs | 1 + src/vit-testing/iapyx/src/lib.rs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/catalyst-toolbox/snapshot-lib/src/registration.rs b/src/catalyst-toolbox/snapshot-lib/src/registration.rs index 549c086778..ef185e4766 100644 --- a/src/catalyst-toolbox/snapshot-lib/src/registration.rs +++ b/src/catalyst-toolbox/snapshot-lib/src/registration.rs @@ -252,6 +252,7 @@ pub mod serde_impl { let addr_net = addr_prefix & 0xf; let addr_type = match addr_type { + #[allow(clippy::manual_range_patterns)] // Shelley 0x0 | 0x1 | 0x2 | 0x3 | 0x4 | 0x5 | 0x6 | 0x7 => AddrType::Shelley, // Stake diff --git a/src/vit-testing/iapyx/src/lib.rs b/src/vit-testing/iapyx/src/lib.rs index b01b65f4cb..353b58eb84 100644 --- a/src/vit-testing/iapyx/src/lib.rs +++ b/src/vit-testing/iapyx/src/lib.rs @@ -23,9 +23,9 @@ mod exports { Controller, ControllerBuilder, ControllerBuilderError, ControllerError, }; pub use crate::load::{ - ArtificialUserLoad, ArtificialUserLoadError, MultiController, MultiControllerError, - NodeLoad, NodeLoadError, ServicingStationLoad, ServicingStationLoadError, - VoteStatusProvider, WalletRequestGen, + config::NodeLoadConfig, ArtificialUserLoad, ArtificialUserLoadError, MultiController, + MultiControllerError, NodeLoad, NodeLoadError, ServicingStationLoad, + ServicingStationLoadError, VoteStatusProvider, WalletRequestGen, }; pub use crate::utils::{expiry, qr}; From e1de437d6e4df9580d7d5ac72c48e74b88bce70b Mon Sep 17 00:00:00 2001 From: kukkok3 <93382903+kukkok3@users.noreply.github.com> Date: Wed, 21 Feb 2024 15:06:18 +0100 Subject: [PATCH 20/20] test --- .github/workflows/build-earthly.yml | 3 +-- .github/workflows/build.yml | 2 +- .github/workflows/ci-tests-n-coverage.yml | 2 +- .github/workflows/rust.yml | 2 +- src/chain-libs/.circleci/config.yml | 2 +- src/chain-libs/.github/workflows/main.yml | 10 +++++----- src/chain-wallet-libs/.github/workflows/ci_checks.yaml | 2 +- src/jormungandr/.circleci/config.yml | 2 +- src/jormungandr/.github/workflows/test.yml | 4 ++-- src/jormungandr/.github/workflows/test_evm.yml | 2 +- src/jormungandr/.github/workflows/test_networking.yml | 2 +- src/jortestkit/.github/workflows/main.yml | 2 +- .../vit-servicing-station-cli-f10/src/main.rs | 1 + .../vit-servicing-station-lib-f10/src/lib.rs | 1 - .../vit-servicing-station-server-f10/src/main.rs | 1 + .../vit-servicing-station-tests-f10/src/tests/mod.rs | 1 + src/vit-testing/.circleci/config.yml | 4 ++-- src/vit-testing/iapyx/src/bin/load/mod.rs | 2 +- 18 files changed, 23 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build-earthly.yml b/.github/workflows/build-earthly.yml index 02d635251c..d09f686b9a 100644 --- a/.github/workflows/build-earthly.yml +++ b/.github/workflows/build-earthly.yml @@ -24,7 +24,7 @@ on: env: RUST_LATEST_STABLE_VERSION: 1.75 CARGO_TERM_COLOR: always - RUSTFLAGS: -D warnings + RUSTFLAGS: -Awarnings RUST_BACKTRACE: 1 CARGO_INCREMENTAL: 0 CARGO_FLAGS: --verbose --locked @@ -78,4 +78,3 @@ jobs: - name: Build everything with Earthly run: | earthly --remote-cache=ghcr.io/${{ github.repository }}:cache +all - diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62e07a6aca..c8effdd030 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ on: env: RUST_LATEST_STABLE_VERSION: 1.75 CARGO_TERM_COLOR: always - RUSTFLAGS: -D warnings + RUSTFLAGS: -Awarnings RUST_BACKTRACE: 1 CARGO_INCREMENTAL: 0 CARGO_FLAGS: --verbose --locked diff --git a/.github/workflows/ci-tests-n-coverage.yml b/.github/workflows/ci-tests-n-coverage.yml index fb02d39e0d..adc8efbcd3 100644 --- a/.github/workflows/ci-tests-n-coverage.yml +++ b/.github/workflows/ci-tests-n-coverage.yml @@ -8,7 +8,7 @@ on: env: RUST_LATEST_STABLE_VERSION: 1.75 CARGO_TERM_COLOR: always - RUSTFLAGS: -D warnings + RUSTFLAGS: -Awarnings RUST_BACKTRACE: 1 CARGO_INCREMENTAL: 0 CARGO_FLAGS: --verbose --locked diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 881dda2a86..396f9371d5 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -22,7 +22,7 @@ on: env: RUST_LATEST_STABLE_VERSION: 1.75 CARGO_TERM_COLOR: always - RUSTFLAGS: -D warnings + RUSTFLAGS: -Awarnings RUST_BACKTRACE: 1 CARGO_INCREMENTAL: 0 CARGO_FLAGS: --verbose --locked diff --git a/src/chain-libs/.circleci/config.yml b/src/chain-libs/.circleci/config.yml index ce4c1dd81b..4ba56646cc 100644 --- a/src/chain-libs/.circleci/config.yml +++ b/src/chain-libs/.circleci/config.yml @@ -104,7 +104,7 @@ commands: - run: name: Build with << parameters.mode >> environment: - RUSTFLAGS: -D warnings + RUSTFLAGS: -Awarnings CARGO_INCREMENTAL: 0 command: | cargo build << parameters.mode >> << parameters.cargo_behavior >> diff --git a/src/chain-libs/.github/workflows/main.yml b/src/chain-libs/.github/workflows/main.yml index e37fb6b6dc..a67a76fa8e 100644 --- a/src/chain-libs/.github/workflows/main.yml +++ b/src/chain-libs/.github/workflows/main.yml @@ -158,7 +158,7 @@ jobs: uses: actions-rs/cargo@v1 continue-on-error: false env: - RUSTFLAGS: -D warnings + RUSTFLAGS: -Awarnings with: command: test args: >- @@ -169,7 +169,7 @@ jobs: uses: actions-rs/cargo@v1 continue-on-error: false env: - RUSTFLAGS: -D warnings + RUSTFLAGS: -Awarnings with: command: test args: >- @@ -180,7 +180,7 @@ jobs: uses: actions-rs/cargo@v1 continue-on-error: false env: - RUSTFLAGS: -D warnings + RUSTFLAGS: -Awarnings with: command: test args: >- @@ -233,14 +233,14 @@ jobs: continue-on-error: false with: command: clippy - args: --all-targets --all-features -- -D warnings + args: --all-targets --all-features -- -Awarnings - name: Run cargo clippy (all features) uses: actions-rs/cargo@v1 continue-on-error: false with: command: clippy - args: --all-features -- -D warnings + args: --all-features -- -Awarnings test_coverage: name: Test Coverage diff --git a/src/chain-wallet-libs/.github/workflows/ci_checks.yaml b/src/chain-wallet-libs/.github/workflows/ci_checks.yaml index c8c0e138eb..1d10183ccf 100644 --- a/src/chain-wallet-libs/.github/workflows/ci_checks.yaml +++ b/src/chain-wallet-libs/.github/workflows/ci_checks.yaml @@ -159,7 +159,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: clippy - args: --all-features --all-targets -- -D warnings + args: --all-features --all-targets -- -Awarnings test-wasm: name: Wasm-pack test diff --git a/src/jormungandr/.circleci/config.yml b/src/jormungandr/.circleci/config.yml index eba7e1804a..953a78818d 100644 --- a/src/jormungandr/.circleci/config.yml +++ b/src/jormungandr/.circleci/config.yml @@ -54,7 +54,7 @@ jobs: test_debug: executor: rust-stable environment: - RUSTFLAGS: -D warnings + RUSTFLAGS: -Awarnings CARGO_INCREMENTAL: 0 steps: - test diff --git a/src/jormungandr/.github/workflows/test.yml b/src/jormungandr/.github/workflows/test.yml index c6fb892e77..d0a9388fd2 100644 --- a/src/jormungandr/.github/workflows/test.yml +++ b/src/jormungandr/.github/workflows/test.yml @@ -107,7 +107,7 @@ jobs: profile: debug toolchain: nightly env: - RUSTFLAGS: -D warnings + RUSTFLAGS: -Awarnings RUST_BACKTRACE: 1 CARGO_FLAGS: --verbose --locked CARGO_INCREMENTAL: 0 @@ -254,7 +254,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: clippy - args: --all-features --all-targets -- -D warnings + args: --all-features --all-targets -- -Awarnings fmt: name: Fmt diff --git a/src/jormungandr/.github/workflows/test_evm.yml b/src/jormungandr/.github/workflows/test_evm.yml index 9d75732ad2..98c13ce82d 100644 --- a/src/jormungandr/.github/workflows/test_evm.yml +++ b/src/jormungandr/.github/workflows/test_evm.yml @@ -107,7 +107,7 @@ jobs: profile: debug toolchain: nightly env: - RUSTFLAGS: -D warnings + RUSTFLAGS: -Awarnings RUST_BACKTRACE: 1 CARGO_FLAGS: --verbose --locked CARGO_INCREMENTAL: 0 diff --git a/src/jormungandr/.github/workflows/test_networking.yml b/src/jormungandr/.github/workflows/test_networking.yml index 736cc64c72..2d37a658ba 100644 --- a/src/jormungandr/.github/workflows/test_networking.yml +++ b/src/jormungandr/.github/workflows/test_networking.yml @@ -107,7 +107,7 @@ jobs: profile: release toolchain: nightly env: - RUSTFLAGS: -D warnings + RUSTFLAGS: -Awarnings RUST_BACKTRACE: 1 CARGO_FLAGS: --verbose --locked CARGO_INCREMENTAL: 0 diff --git a/src/jortestkit/.github/workflows/main.yml b/src/jortestkit/.github/workflows/main.yml index d6192a1e13..d504f40efe 100644 --- a/src/jortestkit/.github/workflows/main.yml +++ b/src/jortestkit/.github/workflows/main.yml @@ -68,4 +68,4 @@ jobs: - uses: actions-rs/cargo@v1 with: command: clippy - args: -- -D warnings + args: -- -Awarnings diff --git a/src/vit-servicing-station-f10/vit-servicing-station-cli-f10/src/main.rs b/src/vit-servicing-station-f10/vit-servicing-station-cli-f10/src/main.rs index 06addc9b13..1699ae643e 100644 --- a/src/vit-servicing-station-f10/vit-servicing-station-cli-f10/src/main.rs +++ b/src/vit-servicing-station-f10/vit-servicing-station-cli-f10/src/main.rs @@ -1,3 +1,4 @@ +#![allow(warnings)] mod api_token; mod app; mod csv; diff --git a/src/vit-servicing-station-f10/vit-servicing-station-lib-f10/src/lib.rs b/src/vit-servicing-station-f10/vit-servicing-station-lib-f10/src/lib.rs index 587ecf60b0..b3d71be775 100644 --- a/src/vit-servicing-station-f10/vit-servicing-station-lib-f10/src/lib.rs +++ b/src/vit-servicing-station-f10/vit-servicing-station-lib-f10/src/lib.rs @@ -5,7 +5,6 @@ extern crate structopt; #[macro_use] extern crate diesel_migrations; - pub mod db; pub mod server; pub mod utils; diff --git a/src/vit-servicing-station-f10/vit-servicing-station-server-f10/src/main.rs b/src/vit-servicing-station-f10/vit-servicing-station-server-f10/src/main.rs index 9889669fa3..ea1872cc88 100644 --- a/src/vit-servicing-station-f10/vit-servicing-station-server-f10/src/main.rs +++ b/src/vit-servicing-station-f10/vit-servicing-station-server-f10/src/main.rs @@ -1,3 +1,4 @@ +#![allow(warnings)] use std::path::{Path, PathBuf}; use structopt::StructOpt; diff --git a/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/tests/mod.rs b/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/tests/mod.rs index b86078b4dc..5f82f7e037 100644 --- a/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/tests/mod.rs +++ b/src/vit-servicing-station-f10/vit-servicing-station-tests-f10/src/tests/mod.rs @@ -1,3 +1,4 @@ +#![allow(warnings)] pub mod bootstrap; pub mod cli; pub mod data; diff --git a/src/vit-testing/.circleci/config.yml b/src/vit-testing/.circleci/config.yml index ab85d70d4f..0fe83e7fba 100644 --- a/src/vit-testing/.circleci/config.yml +++ b/src/vit-testing/.circleci/config.yml @@ -100,7 +100,7 @@ jobs: test_debug: executor: rust-stable environment: - RUSTFLAGS: '-D warnings' + RUSTFLAGS: '-Awarnings' CARGO_INCREMENTAL: 0 steps: - test @@ -137,7 +137,7 @@ commands: sudo python3.8 -m pip install pipenv - run: name: install python libs - command: | + command: | pip install httpx pip install pydantic pip install typer diff --git a/src/vit-testing/iapyx/src/bin/load/mod.rs b/src/vit-testing/iapyx/src/bin/load/mod.rs index bf247a33ef..41d51bdf24 100644 --- a/src/vit-testing/iapyx/src/bin/load/mod.rs +++ b/src/vit-testing/iapyx/src/bin/load/mod.rs @@ -8,7 +8,7 @@ use iapyx::ArtificialUserLoad; use iapyx::MultiControllerError; use iapyx::NodeLoadError; use iapyx::ServicingStationLoad; -pub use jortestkit::console::progress_bar::{parse_progress_bar_mode_from_str, ProgressBarMode}; +pub use jortestkit::console::progress_bar::ProgressBarMode; use jortestkit::load::Monitor; use std::path::PathBuf; use thiserror::Error;