@@ -58,12 +58,10 @@ use crate::ln::msgs::{UnsignedChannelAnnouncement, UnsignedGossipMessage};
5858use crate :: ln:: script:: ShutdownScript ;
5959use crate :: offers:: invoice:: UnsignedBolt12Invoice ;
6060use crate :: types:: payment:: PaymentPreimage ;
61- use crate :: util:: ser:: { Readable , ReadableArgs , Writeable , Writer } ;
61+ use crate :: util:: ser:: Writeable ;
6262use crate :: util:: transaction_utils;
6363
6464use crate :: crypto:: chacha20:: ChaCha20 ;
65- use crate :: io:: { self , Error } ;
66- use crate :: ln:: msgs:: DecodeError ;
6765use crate :: prelude:: * ;
6866use crate :: sign:: ecdsa:: EcdsaChannelSigner ;
6967#[ cfg( taproot) ]
@@ -811,8 +809,7 @@ pub trait ChannelSigner {
811809 ///
812810 /// This data is static, and will never change for a channel once set. For a given [`ChannelSigner`]
813811 /// instance, LDK will call this method exactly once - either immediately after construction
814- /// (not including if done via [`SignerProvider::read_chan_signer`]) or when the funding
815- /// information has been generated.
812+ /// or when the funding information has been generated.
816813 ///
817814 /// channel_parameters.is_populated() MUST be true.
818815 fn provide_channel_parameters ( & mut self , channel_parameters : & ChannelTransactionParameters ) ;
@@ -983,21 +980,6 @@ pub trait SignerProvider {
983980 & self , channel_value_satoshis : u64 , channel_keys_id : [ u8 ; 32 ] ,
984981 ) -> Self :: EcdsaSigner ;
985982
986- /// Reads a [`Signer`] for this [`SignerProvider`] from the given input stream.
987- /// This is only called during deserialization of other objects which contain
988- /// [`EcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s).
989- /// The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
990- /// contain no versioning scheme. You may wish to include your own version prefix and ensure
991- /// you've read all of the provided bytes to ensure no corruption occurred.
992- ///
993- /// This method is slowly being phased out -- it will only be called when reading objects
994- /// written by LDK versions prior to 0.0.113.
995- ///
996- /// [`Signer`]: Self::EcdsaSigner
997- /// [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
998- /// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
999- fn read_chan_signer ( & self , reader : & [ u8 ] ) -> Result < Self :: EcdsaSigner , DecodeError > ;
1000-
1001983 /// Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
1002984 ///
1003985 /// If this function returns an error, this will result in a channel failing to open.
@@ -1789,74 +1771,6 @@ impl TaprootChannelSigner for InMemorySigner {
17891771 }
17901772}
17911773
1792- const SERIALIZATION_VERSION : u8 = 1 ;
1793-
1794- const MIN_SERIALIZATION_VERSION : u8 = 1 ;
1795-
1796- impl Writeable for InMemorySigner {
1797- fn write < W : Writer > ( & self , writer : & mut W ) -> Result < ( ) , Error > {
1798- write_ver_prefix ! ( writer, SERIALIZATION_VERSION , MIN_SERIALIZATION_VERSION ) ;
1799-
1800- self . funding_key . write ( writer) ?;
1801- self . revocation_base_key . write ( writer) ?;
1802- self . payment_key . write ( writer) ?;
1803- self . delayed_payment_base_key . write ( writer) ?;
1804- self . htlc_base_key . write ( writer) ?;
1805- self . commitment_seed . write ( writer) ?;
1806- self . channel_parameters . write ( writer) ?;
1807- self . channel_value_satoshis . write ( writer) ?;
1808- self . channel_keys_id . write ( writer) ?;
1809-
1810- write_tlv_fields ! ( writer, { } ) ;
1811-
1812- Ok ( ( ) )
1813- }
1814- }
1815-
1816- impl < ES : Deref > ReadableArgs < ES > for InMemorySigner
1817- where
1818- ES :: Target : EntropySource ,
1819- {
1820- fn read < R : io:: Read > ( reader : & mut R , entropy_source : ES ) -> Result < Self , DecodeError > {
1821- let _ver = read_ver_prefix ! ( reader, SERIALIZATION_VERSION ) ;
1822-
1823- let funding_key = Readable :: read ( reader) ?;
1824- let revocation_base_key = Readable :: read ( reader) ?;
1825- let payment_key = Readable :: read ( reader) ?;
1826- let delayed_payment_base_key = Readable :: read ( reader) ?;
1827- let htlc_base_key = Readable :: read ( reader) ?;
1828- let commitment_seed = Readable :: read ( reader) ?;
1829- let counterparty_channel_data = Readable :: read ( reader) ?;
1830- let channel_value_satoshis = Readable :: read ( reader) ?;
1831- let secp_ctx = Secp256k1 :: signing_only ( ) ;
1832- let holder_channel_pubkeys = InMemorySigner :: make_holder_keys (
1833- & secp_ctx,
1834- & funding_key,
1835- & revocation_base_key,
1836- & payment_key,
1837- & delayed_payment_base_key,
1838- & htlc_base_key,
1839- ) ;
1840- let keys_id = Readable :: read ( reader) ?;
1841-
1842- read_tlv_fields ! ( reader, { } ) ;
1843-
1844- Ok ( InMemorySigner {
1845- funding_key,
1846- revocation_base_key,
1847- payment_key,
1848- delayed_payment_base_key,
1849- htlc_base_key,
1850- commitment_seed,
1851- channel_value_satoshis,
1852- holder_channel_pubkeys,
1853- channel_parameters : counterparty_channel_data,
1854- channel_keys_id : keys_id,
1855- entropy_source : RandomBytes :: new ( entropy_source. get_secure_random_bytes ( ) ) ,
1856- } )
1857- }
1858- }
1859-
18601774/// Simple implementation of [`EntropySource`], [`NodeSigner`], and [`SignerProvider`] that takes a
18611775/// 32-byte seed for use as a BIP 32 extended key and derives keys from that.
18621776///
@@ -2295,10 +2209,6 @@ impl SignerProvider for KeysManager {
22952209 self . derive_channel_keys ( channel_value_satoshis, & channel_keys_id)
22962210 }
22972211
2298- fn read_chan_signer ( & self , reader : & [ u8 ] ) -> Result < Self :: EcdsaSigner , DecodeError > {
2299- InMemorySigner :: read ( & mut io:: Cursor :: new ( reader) , self )
2300- }
2301-
23022212 fn get_destination_script ( & self , _channel_keys_id : [ u8 ; 32 ] ) -> Result < ScriptBuf , ( ) > {
23032213 Ok ( self . destination_script . clone ( ) )
23042214 }
@@ -2428,10 +2338,6 @@ impl SignerProvider for PhantomKeysManager {
24282338 self . inner . derive_channel_signer ( channel_value_satoshis, channel_keys_id)
24292339 }
24302340
2431- fn read_chan_signer ( & self , reader : & [ u8 ] ) -> Result < Self :: EcdsaSigner , DecodeError > {
2432- self . inner . read_chan_signer ( reader)
2433- }
2434-
24352341 fn get_destination_script ( & self , channel_keys_id : [ u8 ; 32 ] ) -> Result < ScriptBuf , ( ) > {
24362342 self . inner . get_destination_script ( channel_keys_id)
24372343 }
0 commit comments