diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 1d34aa02ac..7e3431687a 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -58,7 +58,7 @@ jobs: RUSTC_WORKSPACE_WRAPPER: sccache with: command: clippy - args: -- --no-deps -D warnings + args: --all-targets --all-features -- --no-deps -D warnings - name: Run Unit Test Suite uses: actions-rs/cargo@v1 diff --git a/e2e-tests/src/config.rs b/e2e-tests/src/config.rs index 4dc0bac63f..0fbdfe5c75 100644 --- a/e2e-tests/src/config.rs +++ b/e2e-tests/src/config.rs @@ -8,7 +8,7 @@ use crate::accounts::{get_sudo_key, get_validators_keys, get_validators_seeds, N static GLOBAL_CONFIG: Lazy = Lazy::new(|| { let node = get_env("NODE_URL").unwrap_or_else(|| "ws://127.0.0.1:9943".to_string()); - let validator_count = get_env("VALIDATOR_COUNT").unwrap_or_else(|| 5); + let validator_count = get_env("VALIDATOR_COUNT").unwrap_or(5); let validators_seeds = env::var("VALIDATORS_SEEDS") .ok() .map(|s| s.split(',').map(|s| s.to_string()).collect()); @@ -41,7 +41,7 @@ where { env::var(name).ok().map(|v| { v.parse() - .expect(&format!("Failed to parse env var {}", name)) + .unwrap_or_else(|_| panic!("Failed to parse env var {}", name)) }) } diff --git a/finality-aleph/src/network/clique/mock.rs b/finality-aleph/src/network/clique/mock.rs index 1fecd877cb..13ade25354 100644 --- a/finality-aleph/src/network/clique/mock.rs +++ b/finality-aleph/src/network/clique/mock.rs @@ -8,8 +8,8 @@ use std::{ use codec::{Decode, Encode}; use futures::{ - channel::{mpsc, oneshot}, - StreamExt, + channel::{mpsc, mpsc::UnboundedReceiver, oneshot}, + Future, StreamExt, }; use log::info; use rand::Rng; @@ -17,6 +17,7 @@ use tokio::io::{duplex, AsyncRead, AsyncWrite, DuplexStream, ReadBuf}; use crate::network::{ clique::{ + protocols::{ProtocolError, ResultForService}, ConnectionInfo, Dialer, Listener, Network, PeerAddressInfo, PublicKey, SecretKey, Splittable, LOG_TARGET, }, @@ -290,6 +291,12 @@ impl MockNetwork { } } +impl Default for MockNetwork { + fn default() -> Self { + Self::new() + } +} + /// Bidirectional in-memory stream that closes abruptly after a specified /// number of poll_write calls. #[derive(Debug)] @@ -535,3 +542,16 @@ impl UnreliableConnectionMaker { } } } + +pub struct MockPrelims { + pub id_incoming: MockPublicKey, + pub pen_incoming: MockSecretKey, + pub id_outgoing: MockPublicKey, + pub pen_outgoing: MockSecretKey, + pub incoming_handle: Pin>>>>, + pub outgoing_handle: Pin>>>>, + pub data_from_incoming: UnboundedReceiver, + pub data_from_outgoing: Option>, + pub result_from_incoming: UnboundedReceiver>, + pub result_from_outgoing: UnboundedReceiver>, +} diff --git a/finality-aleph/src/network/clique/protocols/v0/mod.rs b/finality-aleph/src/network/clique/protocols/v0/mod.rs index 7c17c39795..5d93a14f14 100644 --- a/finality-aleph/src/network/clique/protocols/v0/mod.rs +++ b/finality-aleph/src/network/clique/protocols/v0/mod.rs @@ -125,29 +125,16 @@ pub async fn incoming( #[cfg(test)] mod tests { - use futures::{ - channel::{mpsc, mpsc::UnboundedReceiver}, - pin_mut, FutureExt, StreamExt, - }; + use futures::{channel::mpsc, pin_mut, FutureExt, StreamExt}; use super::{incoming, outgoing, ProtocolError}; use crate::network::clique::{ - mock::{key, MockPublicKey, MockSecretKey, MockSplittable}, - protocols::{ConnectionType, ResultForService}, + mock::{key, MockPrelims, MockSplittable}, + protocols::ConnectionType, Data, }; - fn prepare() -> ( - MockPublicKey, - MockSecretKey, - MockPublicKey, - MockSecretKey, - impl futures::Future>>, - impl futures::Future>>, - UnboundedReceiver, - UnboundedReceiver>, - UnboundedReceiver>, - ) { + fn prepare() -> MockPrelims { let (stream_incoming, stream_outgoing) = MockSplittable::new(4096); let (id_incoming, pen_incoming) = key(); let (id_outgoing, pen_outgoing) = key(); @@ -155,19 +142,19 @@ mod tests { let (incoming_result_for_service, result_from_incoming) = mpsc::unbounded(); let (outgoing_result_for_service, result_from_outgoing) = mpsc::unbounded(); let (data_for_user, data_from_incoming) = mpsc::unbounded::(); - let incoming_handle = incoming( + let incoming_handle = Box::pin(incoming( stream_incoming, pen_incoming.clone(), incoming_result_for_service, data_for_user, - ); - let outgoing_handle = outgoing( + )); + let outgoing_handle = Box::pin(outgoing( stream_outgoing, pen_outgoing.clone(), id_incoming.clone(), outgoing_result_for_service, - ); - ( + )); + MockPrelims { id_incoming, pen_incoming, id_outgoing, @@ -175,24 +162,22 @@ mod tests { incoming_handle, outgoing_handle, data_from_incoming, + data_from_outgoing: None, result_from_incoming, result_from_outgoing, - ) + } } #[tokio::test] async fn send_data() { - let ( - _id_incoming, - _pen_incoming, - _id_outgoing, - _pen_outgoing, + let MockPrelims { incoming_handle, outgoing_handle, mut data_from_incoming, - _result_from_incoming, + result_from_incoming: _result_from_incoming, mut result_from_outgoing, - ) = prepare::>(); + .. + } = prepare::>(); let incoming_handle = incoming_handle.fuse(); let outgoing_handle = outgoing_handle.fuse(); pin_mut!(incoming_handle); @@ -201,7 +186,7 @@ mod tests { _ = &mut incoming_handle => panic!("incoming process unexpectedly finished"), _ = &mut outgoing_handle => panic!("outgoing process unexpectedly finished"), result = result_from_outgoing.next() => { - let (_, maybe_data_for_outgoing, connection_type) = result.expect("the chennel shouldn't be dropped"); + let (_, maybe_data_for_outgoing, connection_type) = result.expect("the channel shouldn't be dropped"); assert_eq!(connection_type, ConnectionType::LegacyOutgoing); let data_for_outgoing = maybe_data_for_outgoing.expect("successfully connected"); data_for_outgoing @@ -231,17 +216,15 @@ mod tests { #[tokio::test] async fn closed_by_parent_service() { - let ( - _id_incoming, - _pen_incoming, + let MockPrelims { id_outgoing, - _pen_outgoing, incoming_handle, outgoing_handle, - _data_from_incoming, + data_from_incoming: _data_from_incoming, mut result_from_incoming, - _result_from_outgoing, - ) = prepare::>(); + result_from_outgoing: _result_from_outgoing, + .. + } = prepare::>(); let incoming_handle = incoming_handle.fuse(); let outgoing_handle = outgoing_handle.fuse(); pin_mut!(incoming_handle); @@ -251,7 +234,7 @@ mod tests { _ = &mut outgoing_handle => panic!("outgoing process unexpectedly finished"), received = result_from_incoming.next() => { // we drop the exit oneshot channel, thus finishing incoming_handle - let (received_id, _, connection_type) = received.expect("the chennel shouldn't be dropped"); + let (received_id, _, connection_type) = received.expect("the channel shouldn't be dropped"); assert_eq!(connection_type, ConnectionType::LegacyIncoming); assert_eq!(received_id, id_outgoing); }, @@ -263,17 +246,14 @@ mod tests { #[tokio::test] async fn parent_service_dead() { - let ( - _id_incoming, - _pen_incoming, - _id_outgoing, - _pen_outgoing, + let MockPrelims { incoming_handle, outgoing_handle, - _data_from_incoming, + data_from_incoming: _data_from_incoming, result_from_incoming, - _result_from_outgoing, - ) = prepare::>(); + result_from_outgoing: _result_from_outgoing, + .. + } = prepare::>(); std::mem::drop(result_from_incoming); let incoming_handle = incoming_handle.fuse(); let outgoing_handle = outgoing_handle.fuse(); @@ -291,17 +271,14 @@ mod tests { #[tokio::test] async fn parent_user_dead() { - let ( - _id_incoming, - _pen_incoming, - _id_outgoing, - _pen_outgoing, + let MockPrelims { incoming_handle, outgoing_handle, data_from_incoming, - _result_from_incoming, + result_from_incoming: _result_from_incoming, mut result_from_outgoing, - ) = prepare::>(); + .. + } = prepare::>(); std::mem::drop(data_from_incoming); let incoming_handle = incoming_handle.fuse(); let outgoing_handle = outgoing_handle.fuse(); @@ -311,7 +288,7 @@ mod tests { _ = &mut incoming_handle => panic!("incoming process unexpectedly finished"), _ = &mut outgoing_handle => panic!("outgoing process unexpectedly finished"), result = result_from_outgoing.next() => { - let (_, maybe_data_for_outgoing, connection_type) = result.expect("the chennel shouldn't be dropped"); + let (_, maybe_data_for_outgoing, connection_type) = result.expect("the channel shouldn't be dropped"); assert_eq!(connection_type, ConnectionType::LegacyOutgoing); let data_for_outgoing = maybe_data_for_outgoing.expect("successfully connected"); data_for_outgoing @@ -332,17 +309,14 @@ mod tests { #[tokio::test] async fn sender_dead_before_handshake() { - let ( - _id_incoming, - _pen_incoming, - _id_outgoing, - _pen_outgoing, + let MockPrelims { incoming_handle, outgoing_handle, - _data_from_incoming, - _result_from_incoming, - _result_from_outgoing, - ) = prepare::>(); + data_from_incoming: _data_from_incoming, + result_from_incoming: _result_from_incoming, + result_from_outgoing: _result_from_outgoing, + .. + } = prepare::>(); std::mem::drop(outgoing_handle); match incoming_handle.await { Err(ProtocolError::HandshakeError(_)) => (), @@ -353,17 +327,14 @@ mod tests { #[tokio::test] async fn sender_dead_after_handshake() { - let ( - _id_incoming, - _pen_incoming, - _id_outgoing, - _pen_outgoing, + let MockPrelims { incoming_handle, outgoing_handle, - _data_from_incoming, + data_from_incoming: _data_from_incoming, mut result_from_incoming, - _result_from_outgoing, - ) = prepare::>(); + result_from_outgoing: _result_from_outgoing, + .. + } = prepare::>(); let incoming_handle = incoming_handle.fuse(); pin_mut!(incoming_handle); let (_, _exit, connection_type) = tokio::select! { @@ -382,17 +353,14 @@ mod tests { #[tokio::test] async fn receiver_dead_before_handshake() { - let ( - _id_incoming, - _pen_incoming, - _id_outgoing, - _pen_outgoing, + let MockPrelims { incoming_handle, outgoing_handle, - _data_from_incoming, - _result_from_incoming, - _result_from_outgoing, - ) = prepare::>(); + data_from_incoming: _data_from_incoming, + result_from_incoming: _result_from_incoming, + result_from_outgoing: _result_from_outgoing, + .. + } = prepare::>(); std::mem::drop(incoming_handle); match outgoing_handle.await { Err(ProtocolError::HandshakeError(_)) => (), @@ -403,17 +371,14 @@ mod tests { #[tokio::test] async fn receiver_dead_after_handshake() { - let ( - _id_incoming, - _pen_incoming, - _id_outgoing, - _pen_outgoing, + let MockPrelims { incoming_handle, outgoing_handle, - _data_from_incoming, + data_from_incoming: _data_from_incoming, mut result_from_incoming, - _result_from_outgoing, - ) = prepare::>(); + result_from_outgoing: _result_from_outgoing, + .. + } = prepare::>(); let outgoing_handle = outgoing_handle.fuse(); pin_mut!(outgoing_handle); let (_, _exit, connection_type) = tokio::select! { @@ -434,17 +399,14 @@ mod tests { #[tokio::test] async fn receiver_dead_after_handshake_try_send_error() { - let ( - _id_incoming, - _pen_incoming, - _id_outgoing, - _pen_outgoing, + let MockPrelims { incoming_handle, outgoing_handle, - _data_from_incoming, + data_from_incoming: _data_from_incoming, mut result_from_incoming, - _result_from_outgoing, - ) = prepare::>(); + result_from_outgoing: _result_from_outgoing, + .. + } = prepare::>(); let outgoing_handle = outgoing_handle.fuse(); pin_mut!(outgoing_handle); let (_, _exit, connection_type) = tokio::select! { diff --git a/finality-aleph/src/network/clique/protocols/v1/mod.rs b/finality-aleph/src/network/clique/protocols/v1/mod.rs index 978dc3ba8e..701baeb244 100644 --- a/finality-aleph/src/network/clique/protocols/v1/mod.rs +++ b/finality-aleph/src/network/clique/protocols/v1/mod.rs @@ -145,30 +145,16 @@ pub async fn incoming( #[cfg(test)] mod tests { - use futures::{ - channel::{mpsc, mpsc::UnboundedReceiver}, - pin_mut, FutureExt, StreamExt, - }; + use futures::{channel::mpsc, pin_mut, FutureExt, StreamExt}; use super::{incoming, outgoing, ProtocolError}; use crate::network::clique::{ - mock::{key, MockPublicKey, MockSecretKey, MockSplittable}, - protocols::{ConnectionType, ResultForService}, + mock::{key, MockPrelims, MockSplittable}, + protocols::ConnectionType, Data, }; - fn prepare() -> ( - MockPublicKey, - MockSecretKey, - MockPublicKey, - MockSecretKey, - impl futures::Future>>, - impl futures::Future>>, - UnboundedReceiver, - UnboundedReceiver, - UnboundedReceiver>, - UnboundedReceiver>, - ) { + fn prepare() -> MockPrelims { let (stream_incoming, stream_outgoing) = MockSplittable::new(4096); let (id_incoming, pen_incoming) = key(); let (id_outgoing, pen_outgoing) = key(); @@ -177,20 +163,20 @@ mod tests { let (outgoing_result_for_service, result_from_outgoing) = mpsc::unbounded(); let (incoming_data_for_user, data_from_incoming) = mpsc::unbounded::(); let (outgoing_data_for_user, data_from_outgoing) = mpsc::unbounded::(); - let incoming_handle = incoming( + let incoming_handle = Box::pin(incoming( stream_incoming, pen_incoming.clone(), incoming_result_for_service, incoming_data_for_user, - ); - let outgoing_handle = outgoing( + )); + let outgoing_handle = Box::pin(outgoing( stream_outgoing, pen_outgoing.clone(), id_incoming.clone(), outgoing_result_for_service, outgoing_data_for_user, - ); - ( + )); + MockPrelims { id_incoming, pen_incoming, id_outgoing, @@ -198,26 +184,24 @@ mod tests { incoming_handle, outgoing_handle, data_from_incoming, - data_from_outgoing, + data_from_outgoing: Some(data_from_outgoing), result_from_incoming, result_from_outgoing, - ) + } } #[tokio::test] async fn send_data() { - let ( - _id_incoming, - _pen_incoming, - _id_outgoing, - _pen_outgoing, + let MockPrelims { incoming_handle, outgoing_handle, mut data_from_incoming, - mut data_from_outgoing, + data_from_outgoing, mut result_from_incoming, mut result_from_outgoing, - ) = prepare::>(); + .. + } = prepare::>(); + let mut data_from_outgoing = data_from_outgoing.expect("No data from outgoing!"); let incoming_handle = incoming_handle.fuse(); let outgoing_handle = outgoing_handle.fuse(); pin_mut!(incoming_handle); @@ -226,7 +210,7 @@ mod tests { _ = &mut incoming_handle => panic!("incoming process unexpectedly finished"), _ = &mut outgoing_handle => panic!("outgoing process unexpectedly finished"), result = result_from_outgoing.next() => { - let (_, maybe_data_for_outgoing, connection_type) = result.expect("the chennel shouldn't be dropped"); + let (_, maybe_data_for_outgoing, connection_type) = result.expect("the channel shouldn't be dropped"); assert_eq!(connection_type, ConnectionType::New); let data_for_outgoing = maybe_data_for_outgoing.expect("successfully connected"); data_for_outgoing @@ -242,7 +226,7 @@ mod tests { _ = &mut incoming_handle => panic!("incoming process unexpectedly finished"), _ = &mut outgoing_handle => panic!("outgoing process unexpectedly finished"), result = result_from_incoming.next() => { - let (_, maybe_data_for_incoming, connection_type) = result.expect("the chennel shouldn't be dropped"); + let (_, maybe_data_for_incoming, connection_type) = result.expect("the channel shouldn't be dropped"); assert_eq!(connection_type, ConnectionType::New); let data_for_incoming = maybe_data_for_incoming.expect("successfully connected"); data_for_incoming @@ -286,18 +270,16 @@ mod tests { #[tokio::test] async fn closed_by_parent_service() { - let ( - _id_incoming, - _pen_incoming, + let MockPrelims { id_outgoing, - _pen_outgoing, incoming_handle, outgoing_handle, - _data_from_incoming, - _data_from_outgoing, + data_from_incoming: _data_from_incoming, + data_from_outgoing: _data_from_outgoing, mut result_from_incoming, - _result_from_outgoing, - ) = prepare::>(); + result_from_outgoing: _result_from_outgoing, + .. + } = prepare::>(); let incoming_handle = incoming_handle.fuse(); let outgoing_handle = outgoing_handle.fuse(); pin_mut!(incoming_handle); @@ -307,7 +289,7 @@ mod tests { _ = &mut outgoing_handle => panic!("outgoing process unexpectedly finished"), received = result_from_incoming.next() => { // we drop the data sending channel, thus finishing incoming_handle - let (received_id, _, connection_type) = received.expect("the chennel shouldn't be dropped"); + let (received_id, _, connection_type) = received.expect("the channel shouldn't be dropped"); assert_eq!(connection_type, ConnectionType::New); assert_eq!(received_id, id_outgoing); }, @@ -319,18 +301,15 @@ mod tests { #[tokio::test] async fn parent_service_dead() { - let ( - _id_incoming, - _pen_incoming, - _id_outgoing, - _pen_outgoing, + let MockPrelims { incoming_handle, outgoing_handle, - _data_from_incoming, - _data_from_outgoing, + data_from_incoming: _data_from_incoming, + data_from_outgoing: _data_from_outgoing, result_from_incoming, - _result_from_outgoing, - ) = prepare::>(); + result_from_outgoing: _result_from_outgoing, + .. + } = prepare::>(); std::mem::drop(result_from_incoming); let incoming_handle = incoming_handle.fuse(); let outgoing_handle = outgoing_handle.fuse(); @@ -348,18 +327,15 @@ mod tests { #[tokio::test] async fn parent_user_dead() { - let ( - _id_incoming, - _pen_incoming, - _id_outgoing, - _pen_outgoing, + let MockPrelims { incoming_handle, outgoing_handle, data_from_incoming, - _data_from_outgoing, - _result_from_incoming, + data_from_outgoing: _data_from_outgoing, + result_from_incoming: _result_from_incoming, mut result_from_outgoing, - ) = prepare::>(); + .. + } = prepare::>(); std::mem::drop(data_from_incoming); let incoming_handle = incoming_handle.fuse(); let outgoing_handle = outgoing_handle.fuse(); @@ -369,7 +345,7 @@ mod tests { _ = &mut incoming_handle => panic!("incoming process unexpectedly finished"), _ = &mut outgoing_handle => panic!("outgoing process unexpectedly finished"), result = result_from_outgoing.next() => { - let (_, maybe_data_for_outgoing, connection_type) = result.expect("the chennel shouldn't be dropped"); + let (_, maybe_data_for_outgoing, connection_type) = result.expect("the channel shouldn't be dropped"); assert_eq!(connection_type, ConnectionType::New); let data_for_outgoing = maybe_data_for_outgoing.expect("successfully connected"); data_for_outgoing @@ -390,18 +366,15 @@ mod tests { #[tokio::test] async fn sender_dead_before_handshake() { - let ( - _id_incoming, - _pen_incoming, - _id_outgoing, - _pen_outgoing, + let MockPrelims { incoming_handle, outgoing_handle, - _data_from_incoming, - _data_from_outgoing, - _result_from_incoming, - _result_from_outgoing, - ) = prepare::>(); + data_from_incoming: _data_from_incoming, + data_from_outgoing: _data_from_outgoing, + result_from_incoming: _result_from_incoming, + result_from_outgoing: _result_from_outgoing, + .. + } = prepare::>(); std::mem::drop(outgoing_handle); match incoming_handle.await { Err(ProtocolError::HandshakeError(_)) => (), @@ -412,18 +385,15 @@ mod tests { #[tokio::test] async fn sender_dead_after_handshake() { - let ( - _id_incoming, - _pen_incoming, - _id_outgoing, - _pen_outgoing, + let MockPrelims { incoming_handle, outgoing_handle, - _data_from_incoming, - _data_from_outgoing, + data_from_incoming: _data_from_incoming, + data_from_outgoing: _data_from_outgoing, mut result_from_incoming, - _result_from_outgoing, - ) = prepare::>(); + result_from_outgoing: _result_from_outgoing, + .. + } = prepare::>(); let incoming_handle = incoming_handle.fuse(); pin_mut!(incoming_handle); let (_, _exit, connection_type) = tokio::select! { @@ -442,18 +412,15 @@ mod tests { #[tokio::test] async fn receiver_dead_before_handshake() { - let ( - _id_incoming, - _pen_incoming, - _id_outgoing, - _pen_outgoing, + let MockPrelims { incoming_handle, outgoing_handle, - _data_from_incoming, - _data_from_outgoing, - _result_from_incoming, - _result_from_outgoing, - ) = prepare::>(); + data_from_incoming: _data_from_incoming, + data_from_outgoing: _data_from_outgoing, + result_from_incoming: _result_from_incoming, + result_from_outgoing: _result_from_outgoing, + .. + } = prepare::>(); std::mem::drop(incoming_handle); match outgoing_handle.await { Err(ProtocolError::HandshakeError(_)) => (), diff --git a/finality-aleph/src/network/data/component.rs b/finality-aleph/src/network/data/component.rs index 75cfd3c323..c154ff1664 100644 --- a/finality-aleph/src/network/data/component.rs +++ b/finality-aleph/src/network/data/component.rs @@ -227,8 +227,8 @@ mod tests { } } - impl Into for IntoType { - fn into(self) -> FromType { + impl From for FromType { + fn from(_value: IntoType) -> Self { FromType::A } } diff --git a/finality-aleph/src/testing/data_store.rs b/finality-aleph/src/testing/data_store.rs index 7005b69942..ceb32cfde3 100644 --- a/finality-aleph/src/testing/data_store.rs +++ b/finality-aleph/src/testing/data_store.rs @@ -260,7 +260,7 @@ async fn correct_messages_go_through() { .await; for i in 1..=MAX_DATA_BRANCH_LEN { - let blocks_branch = blocks[0..(i as usize)].to_vec(); + let blocks_branch = blocks[0..i].to_vec(); let test_data: TestData = vec![aleph_data_from_blocks(blocks_branch)]; test_handler.send_data(test_data.clone()); @@ -282,7 +282,7 @@ async fn too_long_branch_message_does_not_go_through() { test_handler.finalize_block(&blocks[MAX_DATA_BRANCH_LEN + 2].hash()); - let blocks_branch = blocks[0..((MAX_DATA_BRANCH_LEN + 1) as usize)].to_vec(); + let blocks_branch = blocks[0..(MAX_DATA_BRANCH_LEN + 1)].to_vec(); let test_data: TestData = vec![aleph_data_from_blocks(blocks_branch)]; test_handler.send_data(test_data.clone()); test_handler @@ -381,7 +381,7 @@ async fn branch_with_not_finalized_ancestor_correctly_handled() { fn send_proposals_of_each_len(blocks: Vec, test_handler: &mut TestHandler) { for i in 1..=MAX_DATA_BRANCH_LEN { - let blocks_branch = blocks[0..(i as usize)].to_vec(); + let blocks_branch = blocks[0..i].to_vec(); let test_data: TestData = vec![aleph_data_from_blocks(blocks_branch)]; test_handler.send_data(test_data.clone()); } diff --git a/fork-off/Cargo.lock b/fork-off/Cargo.lock index e9fa11e878..73cec88c08 100644 --- a/fork-off/Cargo.lock +++ b/fork-off/Cargo.lock @@ -839,7 +839,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-off" -version = "1.3.0" +version = "1.4.0" dependencies = [ "anyhow", "async-channel", diff --git a/pallets/elections/src/mock.rs b/pallets/elections/src/mock.rs index 492823bfb5..d7eb53f13c 100644 --- a/pallets/elections/src/mock.rs +++ b/pallets/elections/src/mock.rs @@ -275,10 +275,7 @@ impl TestExtBuilder { .chain(self.reserved_validators.iter()) .collect(); - let balances: Vec<_> = validators - .iter() - .map(|i| (**i as u64, 10_000_000)) - .collect(); + let balances: Vec<_> = validators.iter().map(|i| (**i, 10_000_000)).collect(); pallet_balances::GenesisConfig:: { balances } .assimilate_storage(&mut t) diff --git a/scripts/run_checks_on_aleph_node.sh b/scripts/run_checks_on_aleph_node.sh index 7b0dffe210..c4b1237496 100755 --- a/scripts/run_checks_on_aleph_node.sh +++ b/scripts/run_checks_on_aleph_node.sh @@ -2,6 +2,6 @@ set -e -CARGO_INCREMENTAL=0 cargo clippy --all-targets --all-features --no-deps +CARGO_INCREMENTAL=0 cargo clippy --all-targets --all-features -- --no-deps -D warnings CARGO_INCREMENTAL=0 cargo fmt --all CARGO_INCREMENTAL=0 cargo test --lib