#[derive(Debug, Clone)]
pub struct BipProtocolHandler {
}
impl Default for BipProtocolHandler {
fn default() -> Self {
Self::new()
}
}
impl BipProtocolHandler {
pub fn new() -> Self {
Self {}
}
}
#[derive(Debug, Clone)]
pub struct SegwitValidator {
}
impl Default for SegwitValidator {
fn default() -> Self {
Self::new()
}
}
impl SegwitValidator {
pub fn new() -> Self {
Self {}
}
}
#[derive(Debug, Clone)]
pub struct TaprootEngine {
}
impl Default for TaprootEngine {
fn default() -> Self {
Self::new()
}
}
impl TaprootEngine {
pub fn new() -> Self {
Self {}
}
}
#[derive(Debug, Clone)]
pub struct LdkNode {
}
impl Default for LdkNode {
fn default() -> Self {
Self::new()
}
}
impl LdkNode {
pub fn new() -> Self {
Self {}
}
}
#[derive(Debug, Clone)]
pub struct BoltProtocolHandler {
}
impl Default for BoltProtocolHandler {
fn default() -> Self {
Self::new()
}
}
impl BoltProtocolHandler {
pub fn new() -> Self {
Self {}
}
}
#[derive(Debug, Clone)]
pub struct SpvCrossChainVerifier {
}
impl Default for SpvCrossChainVerifier {
fn default() -> Self {
Self::new()
}
}
impl SpvCrossChainVerifier {
pub fn new() -> Self {
Self {}
}
}
#[derive(Debug, Clone)]
pub struct SidechainBridge {
}
impl Default for SidechainBridge {
fn default() -> Self {
Self::new()
}
}
impl SidechainBridge {
pub fn new() -> Self {
Self {}
}
}
#[derive(Debug, Clone)]
pub struct ProtocolConfig {
#[cfg(feature = "rust-bitcoin")]
pub network: bitcoin::Network,
#[cfg(not(feature = "rust-bitcoin"))]
pub network: String, }
impl Default for ProtocolConfig {
fn default() -> Self {
Self {
#[cfg(feature = "rust-bitcoin")]
network: bitcoin::Network::Bitcoin,
#[cfg(not(feature = "rust-bitcoin"))]
network: "bitcoin".to_string(),
}
}
}
pub type Result<T> = std::result::Result<T, Box<dyn std::error::Error>>;
pub struct ProtocolManager {
#[allow(dead_code)]
bip_handler: BipProtocolHandler,
#[allow(dead_code)]
segwit_verifier: SegwitValidator,
#[allow(dead_code)]
taproot_engine: TaprootEngine,
#[allow(dead_code)]
bolt_processor: BoltProtocolHandler,
#[allow(dead_code)]
spv_verifier: SpvCrossChainVerifier,
#[allow(dead_code)]
sidechain_bridge: SidechainBridge,
}
impl ProtocolManager {
pub fn new(_config: ProtocolConfig) -> Result<Self> {
Ok(Self {
bip_handler: BipProtocolHandler::new(),
segwit_verifier: SegwitValidator::new(),
taproot_engine: TaprootEngine::new(),
bolt_processor: BoltProtocolHandler::new(),
spv_verifier: SpvCrossChainVerifier::new(),
sidechain_bridge: SidechainBridge::new(),
})
}
pub fn with_defaults() -> Result<Self> {
Self::new(ProtocolConfig::default())
}
}