projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Stop decaying liquidity information during bounds-based scoring
[rust-lightning]
/
lightning
/
src
/
sign
/
type_resolver.rs
diff --git
a/lightning/src/sign/type_resolver.rs
b/lightning/src/sign/type_resolver.rs
index 8b6e8091785663df18c5ac197eed3c679b2a15d5..2a122da34470332e1147a427de86c864abe4adab 100644
(file)
--- a/
lightning/src/sign/type_resolver.rs
+++ b/
lightning/src/sign/type_resolver.rs
@@
-1,32
+1,43
@@
-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)
// 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 {
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 {
}
}
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,
}
}
}
}
- pub(crate) fn as_ecdsa(&self) -> Option<&ECS> {
+ #[allow(unused)]
+ pub(crate) fn as_ecdsa(&self) -> Option<&<SP::Target as SignerProvider>::EcdsaSigner> {
match self {
match self {
- ChannelSignerType::Ecdsa(ecs) => Some(ecs)
+ ChannelSignerType::Ecdsa(ecs) => Some(ecs),
+ _ => None
}
}
}
}
- pub(crate) fn as_mut_ecdsa(&mut self) -> Option<&mut ECS> {
+ #[allow(unused)]
+ pub(crate) fn as_mut_ecdsa(&mut self) -> Option<&mut <SP::Target as SignerProvider>::EcdsaSigner> {
match self {
match self {
- ChannelSignerType::Ecdsa(ecs) => Some(ecs)
+ ChannelSignerType::Ecdsa(ecs) => Some(ecs),
+ _ => None
}
}
}
}
}
}