projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Drop fake time advancing in scoring tests
[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 f76650982c2b4f2ae8e4126975d56728b2e4e261..2a122da34470332e1147a427de86c864abe4adab 100644
(file)
--- a/
lightning/src/sign/type_resolver.rs
+++ b/
lightning/src/sign/type_resolver.rs
@@
-1,34
+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,
}
}
#[allow(unused)]
}
}
#[allow(unused)]
- pub(crate) fn as_ecdsa(&self) -> Option<&
ECS
> {
+ 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
}
}
#[allow(unused)]
}
}
#[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 {
match self {
- ChannelSignerType::Ecdsa(ecs) => Some(ecs)
+ ChannelSignerType::Ecdsa(ecs) => Some(ecs),
+ _ => None
}
}
}
}
}
}