use anya_core::protocols::*;
use std::collections::HashMap;
pub use anya_core::protocols::*;
impl ProtocolConfig {
pub fn test_default() -> Self {
Self::default()
}
}
#[derive(Debug, Clone)]
pub enum ComponentCategory {
Consensus,
Network,
CrossChain,
Storage,
}
#[derive(Debug, Clone)]
pub struct Component {
pub name: String,
pub category: ComponentCategory,
}
impl Component {
pub fn new(name: &str, category: ComponentCategory) -> Self {
Self {
name: name.to_string(),
category,
}
}
}
#[derive(Debug)]
pub struct LabelValidator {
rules: HashMap<String, Vec<String>>,
}
impl LabelValidator {
pub fn new() -> Self {
Self {
rules: HashMap::new(),
}
}
pub fn validate_labels(&self, _components: &[Component]) -> Result<(), String> {
Ok(())
}
}
pub async fn setup_lightning_node() -> Result<MockLightningNode, String> {
Ok(MockLightningNode::new())
}
#[derive(Debug)]
pub struct MockLightningNode {
node_id: String,
}
impl MockLightningNode {
pub fn new() -> Self {
Self {
node_id: "mock_node_id".to_string(),
}
}
pub fn get_node_id(&self) -> &str {
&self.node_id
}
}
impl TaprootEngine {
pub fn build_taproot_transaction(
&self,
_inputs: Vec<super::bitcoin_compat::TaprootInput>,
_outputs: Vec<bitcoin::TxOut>,
_fee_rate: bitcoin::FeeRate
) -> Result<bitcoin::Transaction, String> {
Ok(super::bitcoin_compat::create_test_transaction())
}
}
impl SegwitValidator {
pub fn verify_taproot(&self, _tx: &bitcoin::Transaction) -> Result<(), String> {
Ok(())
}
}
impl LdkNode {
pub fn create_offer(&self, _request: super::bitcoin_compat::OfferRequest) -> Result<String, String> {
Ok("mock_offer_id".to_string())
}
pub fn send_payment_for_offer(&self, _offer_id: &str) -> Result<String, String> {
Ok("mock_payment_hash".to_string())
}
}
impl SpvCrossChainVerifier {
pub fn verify_proof(&self, _proof: &super::bitcoin_compat::CrossChainProof) -> Result<bool, String> {
Ok(true)
}
}