Skip to content

Commit

Permalink
move counterparty payment script to default channelsigner
Browse files Browse the repository at this point in the history
  • Loading branch information
tankyleo committed Dec 2, 2024
1 parent 8f78337 commit 30b4b43
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
9 changes: 3 additions & 6 deletions lightning/src/sign/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,9 @@ pub trait ChannelSigner {
/// Document this next
fn get_counterparty_payment_script(
&self, channel_type_features: &ChannelTypeFeatures, payment_key: &PublicKey,
) -> ScriptBuf;
) -> ScriptBuf {
chan_utils::get_counterparty_payment_script(channel_type_features, payment_key)
}
/// Gets the per-commitment point for a specific commitment number
///
/// Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
Expand Down Expand Up @@ -1337,11 +1339,6 @@ impl EntropySource for InMemorySigner {
}

impl ChannelSigner for InMemorySigner {
fn get_counterparty_payment_script(
&self, channel_type_features: &ChannelTypeFeatures, payment_key: &PublicKey,
) -> ScriptBuf {
chan_utils::get_counterparty_payment_script(channel_type_features, payment_key)
}
fn get_per_commitment_point(
&self, idx: u64, secp_ctx: &Secp256k1<secp256k1::All>,
) -> Result<PublicKey, ()> {
Expand Down
3 changes: 0 additions & 3 deletions lightning/src/util/test_channel_signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,6 @@ impl TestChannelSigner {
}

impl ChannelSigner for TestChannelSigner {
fn get_counterparty_payment_script(&self, channel_type_features: &ChannelTypeFeatures, payment_key: &PublicKey) -> ScriptBuf {
chan_utils::get_counterparty_payment_script(channel_type_features, payment_key)
}
fn get_per_commitment_point(&self, idx: u64, secp_ctx: &Secp256k1<secp256k1::All>) -> Result<PublicKey, ()> {
#[cfg(test)]
if !self.is_signer_available(SignerOp::GetPerCommitmentPoint) {
Expand Down

0 comments on commit 30b4b43

Please sign in to comment.