Remove unused NodeSigner implementations in tests
[rust-lightning] / lightning / src / util / test_utils.rs
index b0187f0201344ebee1379435a50a915e0d58350f..627ee54ebafa019363a432331e6bf3ac4064538f 100644 (file)
@@ -51,7 +51,7 @@ use crate::sync::{Mutex, Arc};
 use core::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
 use core::mem;
 use bitcoin::bech32::u5;
-use crate::chain::keysinterface::{InMemorySigner, Recipient, KeyMaterial, EntropySource, NodeSigner, SignerProvider};
+use crate::chain::keysinterface::{InMemorySigner, Recipient, EntropySource, NodeSigner, SignerProvider};
 
 #[cfg(feature = "std")]
 use std::time::{SystemTime, UNIX_EPOCH};
@@ -107,17 +107,6 @@ pub struct OnlyReadsKeysInterface {}
 impl EntropySource for OnlyReadsKeysInterface {
        fn get_secure_random_bytes(&self) -> [u8; 32] { [0; 32] }}
 
-impl NodeSigner for OnlyReadsKeysInterface {
-       fn get_node_secret(&self, _recipient: Recipient) -> Result<SecretKey, ()> { unreachable!(); }
-       fn get_node_id(&self, recipient: Recipient) -> Result<PublicKey, ()> {
-               let secp_ctx = Secp256k1::signing_only();
-               Ok(PublicKey::from_secret_key(&secp_ctx, &self.get_node_secret(recipient)?))
-       }
-       fn ecdh(&self, _recipient: Recipient, _other_key: &PublicKey, _tweak: Option<&Scalar>) -> Result<SharedSecret, ()> { unreachable!(); }
-       fn get_inbound_payment_key_material(&self) -> KeyMaterial { unreachable!(); }
-       fn sign_invoice(&self, _hrp_bytes: &[u8], _invoice_data: &[u5], _recipient: Recipient) -> Result<RecoverableSignature, ()> { unreachable!(); }
-}
-
 impl SignerProvider for OnlyReadsKeysInterface {
        type Signer = EnforcingSigner;
 
@@ -337,10 +326,10 @@ impl Drop for TestChannelMessageHandler {
 }
 
 impl msgs::ChannelMessageHandler for TestChannelMessageHandler {
-       fn handle_open_channel(&self, _their_node_id: &PublicKey, _their_features: InitFeatures, msg: &msgs::OpenChannel) {
+       fn handle_open_channel(&self, _their_node_id: &PublicKey, msg: &msgs::OpenChannel) {
                self.received_msg(wire::Message::OpenChannel(msg.clone()));
        }
-       fn handle_accept_channel(&self, _their_node_id: &PublicKey, _their_features: InitFeatures, msg: &msgs::AcceptChannel) {
+       fn handle_accept_channel(&self, _their_node_id: &PublicKey, msg: &msgs::AcceptChannel) {
                self.received_msg(wire::Message::AcceptChannel(msg.clone()));
        }
        fn handle_funding_created(&self, _their_node_id: &PublicKey, msg: &msgs::FundingCreated) {
@@ -352,7 +341,7 @@ impl msgs::ChannelMessageHandler for TestChannelMessageHandler {
        fn handle_channel_ready(&self, _their_node_id: &PublicKey, msg: &msgs::ChannelReady) {
                self.received_msg(wire::Message::ChannelReady(msg.clone()));
        }
-       fn handle_shutdown(&self, _their_node_id: &PublicKey, _their_features: &InitFeatures, msg: &msgs::Shutdown) {
+       fn handle_shutdown(&self, _their_node_id: &PublicKey, msg: &msgs::Shutdown) {
                self.received_msg(wire::Message::Shutdown(msg.clone()));
        }
        fn handle_closing_signed(&self, _their_node_id: &PublicKey, msg: &msgs::ClosingSigned) {