anya-core 1.2.0

Enterprise-grade Bitcoin Infrastructure Platform
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::error::Error;
impl LabelValidator {
    pub fn validate_component(&self, component: &Component) -> Result<()> {
        let required_labels = match component.category {
            ComponentCategory::Consensus => vec!["BPC-3", "RES-3"],
            ComponentCategory::Network => vec!["AIS-3", "SCL-3", "BPC-3"],
            ComponentCategory::SmartContract => vec!["AIT-3", "BPC-3"],
            ComponentCategory::CrossChain => vec!["RES-3", "SCL-3"],
        };
        
        if !component.labels.contains_all(&required_labels) {
            return Err(LabelError::MissingRequirements(required_labels));
        }
        
        Ok(())
    }
}