projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Re-order imports
[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..fad8c0ac96c0689fecfb7858f346aae63afe983c 100644
(file)
--- a/
lightning/src/sign/type_resolver.rs
+++ b/
lightning/src/sign/type_resolver.rs
@@
-1,34
+1,51
@@
-use crate::sign::{ChannelSigner, EcdsaChannelSigner};
+use crate::sign::{ChannelSigner, SignerProvider};
+use core::ops::Deref;
-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,
}
}
}
}
}
}