Use `ChannelError::close` constructor when building a close variant
[rust-lightning] / lightning / src / util / test_channel_signer.rs
index 64320bbbaf55eb08f295296abc3109c5b23697ab..2009e4d0b08a9a22fd68941b8290bfabffe75203 100644 (file)
@@ -13,7 +13,7 @@ use crate::ln::channel_keys::{HtlcKey};
 use crate::ln::msgs;
 use crate::ln::types::PaymentPreimage;
 use crate::sign::{InMemorySigner, ChannelSigner};
-use crate::sign::ecdsa::{EcdsaChannelSigner, WriteableEcdsaChannelSigner};
+use crate::sign::ecdsa::EcdsaChannelSigner;
 
 #[allow(unused_imports)]
 use crate::prelude::*;
@@ -250,8 +250,8 @@ impl EcdsaChannelSigner for TestChannelSigner {
                        } else {
                                EcdsaSighashType::All
                        };
-                       let sighash = &sighash::SighashCache::new(&*htlc_tx).segwit_signature_hash(
-                               input, &witness_script, htlc_descriptor.htlc.amount_msat / 1000, sighash_type
+                       let sighash = &sighash::SighashCache::new(&*htlc_tx).p2wsh_signature_hash(
+                               input, &witness_script, htlc_descriptor.htlc.to_bitcoin_amount(), sighash_type
                        ).unwrap();
                        let countersignatory_htlc_key = HtlcKey::from_basepoint(
                                &secp_ctx, &self.inner.counterparty_pubkeys().unwrap().htlc_basepoint, &htlc_descriptor.per_commitment_point,
@@ -297,8 +297,6 @@ impl EcdsaChannelSigner for TestChannelSigner {
        }
 }
 
-impl WriteableEcdsaChannelSigner for TestChannelSigner {}
-
 #[cfg(taproot)]
 impl TaprootChannelSigner for TestChannelSigner {
        fn generate_local_nonce_pair(&self, commitment_number: u64, secp_ctx: &Secp256k1<All>) -> PublicNonce {