#![allow(dead_code, unused_imports)]
use crate::{
AdvancedTipSelection,
Confidence,
Consensus,
ConsensusConfig,
ConsensusError,
ConsensusMetrics,
ConsensusStatus,
Dag,
DagError as DagModuleError,
DagError,
DagMessage,
Edge,
Graph,
GraphMetrics,
Node,
NodeState,
ParentSelectionAlgorithm,
QRAvalanche,
QRAvalancheConfig,
QrDag,
Result,
SerializableHash,
StorageConfig,
TipSelection,
TipSelectionConfig,
TipSelectionError,
Vertex,
VertexError,
VertexId,
VertexOps,
VertexWeight,
VotingRecord,
};
fn _compile_test() -> Result<()> {
let _vertex_id: VertexId = VertexId::new();
let _vertex: Vertex = Vertex::new(
_vertex_id.clone(),
vec![1, 2, 3],
std::collections::HashSet::new(),
);
let _dag: QrDag = QrDag::new();
let _consensus: QRAvalanche = QRAvalanche::new();
let _graph: Graph = Graph::new();
let _node: Node = Node::new(vec![1, 2, 3], vec![]);
let _dag_config: ConsensusConfig = ConsensusConfig::default();
let _qr_config: QRAvalancheConfig = QRAvalancheConfig::default();
let _storage_config: StorageConfig = StorageConfig::default();
let _tip_config: TipSelectionConfig = TipSelectionConfig::default();
let _consensus_status: ConsensusStatus = ConsensusStatus::Pending;
let _node_state: NodeState = NodeState::Pending;
let _vertex_error: VertexError = VertexError::InvalidParent;
let _consensus_error: ConsensusError = ConsensusError::InvalidVertex;
let _dag_error: DagError = DagError::NodeExists("test".to_string());
let _result: Result<()> = Ok(());
Ok(())
}
fn _trait_test() {
fn _use_consensus<T: Consensus>(_consensus: T) {}
fn _use_tip_selection<T: TipSelection>(_tip_selection: T) {}
fn _use_vertex_ops<T: VertexOps>(_vertex_ops: T) {}
let _consensus_trait: Box<dyn Consensus> = panic!("compile test only");
}
fn _standard_traits_test() {
fn _test_debug<T: std::fmt::Debug>(_t: T) {}
_test_debug(VertexId::new());
_test_debug(ConsensusStatus::Pending);
_test_debug(NodeState::Pending);
_test_debug(VertexError::InvalidParent);
_test_debug(ConsensusError::InvalidVertex);
_test_debug(DagError::NodeExists("test".to_string()));
fn _test_clone<T: Clone>(_t: T) {}
_test_clone(VertexId::new());
_test_clone(ConsensusStatus::Pending);
_test_clone(NodeState::Pending);
_test_clone(ConsensusConfig::default());
_test_clone(QRAvalancheConfig::default());
_test_clone(StorageConfig::default());
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn compilation_test() {
println!("All types compile successfully");
}
}