Merge pull request #1389 from lightning-signer/2022-03-bitcoin
[rust-lightning] / lightning / src / util / ser.rs
index 6a52e5e1c898230c0d31a4cb9ce20c6acc236076..69fd14640ae605bc2d481f40760ee48d3a502eb6 100644 (file)
@@ -17,9 +17,9 @@ use core::hash::Hash;
 use sync::Mutex;
 use core::cmp;
 
-use bitcoin::secp256k1::Signature;
-use bitcoin::secp256k1::key::{PublicKey, SecretKey};
+use bitcoin::secp256k1::{PublicKey, SecretKey};
 use bitcoin::secp256k1::constants::{PUBLIC_KEY_SIZE, SECRET_KEY_SIZE, COMPACT_SIGNATURE_SIZE};
+use bitcoin::secp256k1::ecdsa::Signature;
 use bitcoin::blockdata::script::Script;
 use bitcoin::blockdata::transaction::{OutPoint, Transaction, TxOut};
 use bitcoin::consensus;
@@ -174,6 +174,7 @@ pub trait Writeable {
        }
 
        /// Writes self out to a Vec<u8>
+       #[cfg(test)]
        fn encode_with_len(&self) -> Vec<u8> {
                let mut msg = VecWriter(Vec::new());
                0u16.write(&mut msg).unwrap();