tabify tests (#3220)

* tabify tests

* move mod tests; up
This commit is contained in:
Andronik Ordian
2021-06-12 15:39:18 +02:00
committed by GitHub
parent 7e7b40d11c
commit cbeb7d0afd
18 changed files with 4826 additions and 4830 deletions
@@ -20,10 +20,6 @@
#![warn(missing_docs)]
#[cfg(test)]
mod tests;
use std::collections::{BTreeMap, HashMap, HashSet, hash_map};
use futures::{channel::oneshot, FutureExt as _};
use polkadot_primitives::v1::{
@@ -47,6 +43,9 @@ use polkadot_node_network_protocol::{
PeerId, View, v1 as protocol_v1, UnifiedReputationChange as Rep,
};
#[cfg(test)]
mod tests;
const LOG_TARGET: &str = "parachain::approval-distribution";
const COST_UNEXPECTED_MESSAGE: Rep = Rep::CostMinor("Peer sent an out-of-view assignment or approval");
@@ -51,6 +51,7 @@ use polkadot_node_network_protocol::{
};
use polkadot_node_subsystem_util::request_session_info;
use polkadot_erasure_coding::{branches, branch_hash, recovery_threshold, obtain_chunks_v1};
mod error;
#[cfg(test)]
+2 -6
View File
@@ -64,6 +64,8 @@ use network::{Network, send_message};
mod multiplexer;
pub use multiplexer::RequestMultiplexer;
#[cfg(test)]
mod tests;
/// The maximum amount of heads a peer is allowed to have in their view at any time.
///
@@ -1131,9 +1133,3 @@ async fn dispatch_collation_events_to_all<I>(
ctx.send_messages(events.into_iter().flat_map(messages_for)).await
}
#[cfg(test)]
mod tests;
File diff suppressed because it is too large Load Diff
@@ -44,6 +44,9 @@ use polkadot_node_primitives::{SignedFullStatement, Statement, PoV};
use crate::error::{Fatal, NonFatal, log_error};
use super::{LOG_TARGET, Result};
#[cfg(test)]
mod tests;
const COST_UNEXPECTED_MESSAGE: Rep = Rep::CostMinor("An unexpected message");
#[derive(Clone, Default)]
@@ -866,6 +869,3 @@ pub(crate) async fn run(
}
}
}
#[cfg(test)]
mod tests;
@@ -50,6 +50,9 @@ use polkadot_subsystem::{
use super::{modify_reputation, Result, LOG_TARGET};
#[cfg(test)]
mod tests;
const COLLATION_FETCH_TIMEOUT: Duration = Duration::from_secs(2);
const COST_UNEXPECTED_MESSAGE: Rep = Rep::CostMinor("An unexpected message");
@@ -1244,6 +1247,3 @@ where
false
}
}
#[cfg(test)]
mod tests;
File diff suppressed because it is too large Load Diff
@@ -18,9 +18,6 @@
//! and issuing a connection request to the validators relevant to
//! the gossiping subsystems on every new session.
#[cfg(test)]
mod tests;
use std::time::{Duration, Instant};
use futures::{channel::oneshot, FutureExt as _};
use polkadot_node_subsystem::{
@@ -38,6 +35,9 @@ use polkadot_node_network_protocol::peer_set::PeerSet;
use sp_keystore::{CryptoStore, SyncCryptoStorePtr};
use sp_application_crypto::{Public, AppKey};
#[cfg(test)]
mod tests;
const LOG_TARGET: &str = "parachain::gossip-support";
// How much time should we wait since the last
// authority discovery resolution failure.
@@ -71,6 +71,9 @@ use requester::{RequesterMessage, fetch};
mod responder;
use responder::{ResponderMessage, respond};
#[cfg(test)]
mod tests;
const COST_UNEXPECTED_STATEMENT: Rep = Rep::CostMinor("Unexpected Statement");
const COST_FETCH_FAIL: Rep = Rep::CostMinor("Requesting `CommittedCandidateReceipt` from peer failed");
const COST_INVALID_SIGNATURE: Rep = Rep::CostMajor("Invalid Statement Signature");
@@ -2044,6 +2047,3 @@ impl metrics::Metrics for Metrics {
Ok(Metrics(Some(metrics)))
}
}
#[cfg(test)]
mod tests;
File diff suppressed because it is too large Load Diff