latest_monitor_update_id: u64,
- holder_signer: ChannelSignerType<<SP::Target as SignerProvider>::EcdsaSigner>,
+ holder_signer: ChannelSignerType<SP>,
shutdown_scriptpubkey: Option<ShutdownScript>,
destination_script: ScriptBuf,
/// Returns the holder signer for this channel.
#[cfg(test)]
- pub fn get_signer(&self) -> &ChannelSignerType<<SP::Target as SignerProvider>::EcdsaSigner> {
+ pub fn get_signer(&self) -> &ChannelSignerType<SP> {
return &self.holder_signer
}
ChannelSignerType::Ecdsa(ecdsa) => {
ecdsa.sign_counterparty_commitment(&counterparty_initial_commitment_tx, Vec::new(), &self.secp_ctx)
.map(|(sig, _)| sig).ok()?
- }
+ },
+ // TODO (taproot|arik)
+ _ => todo!()
};
if self.signer_pending_funding {
// We sign "counterparty" commitment transaction, allowing them to broadcast the tx if they wish.
(counterparty_initial_commitment_tx, funding_signed)
- }
+ },
+ // TODO (taproot|arik)
+ _ => todo!()
}
}
}
self.context.cur_counterparty_commitment_transaction_number + 1,
&secret
).map_err(|_| ChannelError::Close("Failed to validate revocation from peer".to_owned()))?;
- }
+ },
+ // TODO (taproot|arik)
+ _ => todo!()
};
self.context.commitment_secrets.provide_secret(self.context.cur_counterparty_commitment_transaction_number + 1, msg.per_commitment_secret)
max_fee_satoshis: our_max_fee,
}),
}), None, None))
- }
+ },
+ // TODO (taproot|arik)
+ _ => todo!()
}
}
max_fee_satoshis: our_max_fee,
}),
}), signed_tx, shutdown_result))
- }
+ },
+ // TODO (taproot|arik)
+ _ => todo!()
}
}
}
}
#[cfg(test)]
- pub fn get_signer(&self) -> &ChannelSignerType<<SP::Target as SignerProvider>::EcdsaSigner> {
+ pub fn get_signer(&self) -> &ChannelSignerType<SP> {
&self.context.holder_signer
}
node_signature: our_node_sig,
bitcoin_signature: our_bitcoin_sig,
})
- }
+ },
+ // TODO (taproot|arik)
+ _ => todo!()
}
}
bitcoin_signature_2: if were_node_one { their_bitcoin_sig } else { our_bitcoin_sig },
contents: announcement,
})
- }
+ },
+ // TODO (taproot|arik)
+ _ => todo!()
}
} else {
Err(ChannelError::Ignore("Attempted to sign channel announcement before we'd received announcement_signatures".to_string()))
#[cfg(taproot)]
partial_signature_with_nonce: None,
}, (counterparty_commitment_txid, commitment_stats.htlcs_included)))
- }
+ },
+ // TODO (taproot|arik)
+ _ => todo!()
}
}
-use crate::sign::{ChannelSigner, EcdsaChannelSigner};
+use core::ops::Deref;
+use crate::sign::{ChannelSigner, SignerProvider};
-pub(crate) enum ChannelSignerType<ECS: EcdsaChannelSigner> {
+pub(crate) enum ChannelSignerType<SP: Deref> where SP::Target: SignerProvider {
// in practice, this will only ever be an EcdsaChannelSigner (specifically, Writeable)
- Ecdsa(ECS)
+ Ecdsa(<SP::Target as SignerProvider>::EcdsaSigner),
+ #[cfg(taproot)]
+ Taproot(<SP::Target as SignerProvider>::TaprootSigner),
}
-impl<ECS: EcdsaChannelSigner> ChannelSignerType<ECS>{
+impl<SP: Deref> ChannelSignerType<SP> where SP::Target: SignerProvider {
pub(crate) fn as_ref(&self) -> &dyn ChannelSigner {
match self {
- ChannelSignerType::Ecdsa(ecs) => ecs
+ ChannelSignerType::Ecdsa(ecs) => ecs,
+ #[cfg(taproot)]
+ ChannelSignerType::Taproot(tcs) => tcs,
}
}
pub(crate) fn as_mut(&mut self) -> &mut dyn ChannelSigner {
match self {
- ChannelSignerType::Ecdsa(ecs) => ecs
+ ChannelSignerType::Ecdsa(ecs) => ecs,
+ #[cfg(taproot)]
+ ChannelSignerType::Taproot(tcs) => tcs,
}
}
#[allow(unused)]
- pub(crate) fn as_ecdsa(&self) -> Option<&ECS> {
+ pub(crate) fn as_ecdsa(&self) -> Option<&<SP::Target as SignerProvider>::EcdsaSigner> {
match self {
- ChannelSignerType::Ecdsa(ecs) => Some(ecs)
+ ChannelSignerType::Ecdsa(ecs) => Some(ecs),
+ _ => None
}
}
#[allow(unused)]
- pub(crate) fn as_mut_ecdsa(&mut self) -> Option<&mut ECS> {
+ pub(crate) fn as_mut_ecdsa(&mut self) -> Option<&mut <SP::Target as SignerProvider>::EcdsaSigner> {
match self {
- ChannelSignerType::Ecdsa(ecs) => Some(ecs)
+ ChannelSignerType::Ecdsa(ecs) => Some(ecs),
+ _ => None
}
}
}