@@ -43,7 +43,7 @@ use ln::channelmanager::{HTLCSource, PaymentPreimage, PaymentHash};
43
43
use ln:: onchaintx:: { OnchainTxHandler , InputDescriptors } ;
44
44
use chain:: chaininterface:: { BroadcasterInterface , FeeEstimator } ;
45
45
use chain:: transaction:: { OutPoint , TransactionData } ;
46
- use chain:: keysinterface:: { SpendableOutputDescriptor , StaticPaymentOutputDescriptor , DelayedPaymentOutputDescriptor , ChannelKeys , KeysInterface } ;
46
+ use chain:: keysinterface:: { SpendableOutputDescriptor , StaticPaymentOutputDescriptor , DelayedPaymentOutputDescriptor , ChannelSigner , KeysInterface } ;
47
47
use util:: logger:: Logger ;
48
48
use util:: ser:: { Readable , ReadableArgs , MaybeReadable , Writer , Writeable , U48 } ;
49
49
use util:: byte_utils;
@@ -623,7 +623,7 @@ impl Readable for ChannelMonitorUpdateStep {
623
623
/// the "reorg path" (ie disconnecting blocks until you find a common ancestor from both the
624
624
/// returned block hash and the the current chain and then reconnecting blocks to get to the
625
625
/// best chain) upon deserializing the object!
626
- pub struct ChannelMonitor < ChanSigner : ChannelKeys > {
626
+ pub struct ChannelMonitor < ChanSigner : ChannelSigner > {
627
627
latest_update_id : u64 ,
628
628
commitment_transaction_number_obscure_factor : u64 ,
629
629
@@ -721,7 +721,7 @@ pub struct ChannelMonitor<ChanSigner: ChannelKeys> {
721
721
#[ cfg( any( test, feature = "fuzztarget" , feature = "_test_utils" ) ) ]
722
722
/// Used only in testing and fuzztarget to check serialization roundtrips don't change the
723
723
/// underlying object
724
- impl < ChanSigner : ChannelKeys > PartialEq for ChannelMonitor < ChanSigner > {
724
+ impl < ChanSigner : ChannelSigner > PartialEq for ChannelMonitor < ChanSigner > {
725
725
fn eq ( & self , other : & Self ) -> bool {
726
726
if self . latest_update_id != other. latest_update_id ||
727
727
self . commitment_transaction_number_obscure_factor != other. commitment_transaction_number_obscure_factor ||
@@ -761,7 +761,7 @@ impl<ChanSigner: ChannelKeys> PartialEq for ChannelMonitor<ChanSigner> {
761
761
}
762
762
}
763
763
764
- impl < ChanSigner : ChannelKeys > Writeable for ChannelMonitor < ChanSigner > {
764
+ impl < ChanSigner : ChannelSigner > Writeable for ChannelMonitor < ChanSigner > {
765
765
fn write < W : Writer > ( & self , writer : & mut W ) -> Result < ( ) , Error > {
766
766
//TODO: We still write out all the serialization here manually instead of using the fancy
767
767
//serialization framework we have, we should migrate things over to it.
@@ -948,7 +948,7 @@ impl<ChanSigner: ChannelKeys> Writeable for ChannelMonitor<ChanSigner> {
948
948
}
949
949
}
950
950
951
- impl < ChanSigner : ChannelKeys > ChannelMonitor < ChanSigner > {
951
+ impl < ChanSigner : ChannelSigner > ChannelMonitor < ChanSigner > {
952
952
pub ( crate ) fn new ( keys : ChanSigner , shutdown_pubkey : & PublicKey ,
953
953
on_counterparty_tx_csv : u16 , destination_script : & Script , funding_info : ( OutPoint , Script ) ,
954
954
channel_parameters : & ChannelTransactionParameters ,
@@ -2253,7 +2253,7 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
2253
2253
/// transaction and losing money. This is a risk because previous channel states
2254
2254
/// are toxic, so it's important that whatever channel state is persisted is
2255
2255
/// kept up-to-date.
2256
- pub trait Persist < Keys : ChannelKeys > : Send + Sync {
2256
+ pub trait Persist < Keys : ChannelSigner > : Send + Sync {
2257
2257
/// Persist a new channel's data. The data can be stored any way you want, but
2258
2258
/// the identifier provided by Rust-Lightning is the channel's outpoint (and
2259
2259
/// it is up to you to maintain a correct mapping between the outpoint and the
@@ -2299,7 +2299,7 @@ pub trait Persist<Keys: ChannelKeys>: Send + Sync {
2299
2299
2300
2300
const MAX_ALLOC_SIZE : usize = 64 * 1024 ;
2301
2301
2302
- impl < ' a , ChanSigner : ChannelKeys , K : KeysInterface < ChanKeySigner = ChanSigner > > ReadableArgs < & ' a K >
2302
+ impl < ' a , ChanSigner : ChannelSigner , K : KeysInterface < ChanSigner = ChanSigner > > ReadableArgs < & ' a K >
2303
2303
for ( BlockHash , ChannelMonitor < ChanSigner > ) {
2304
2304
fn read < R : :: std:: io:: Read > ( reader : & mut R , keys_manager : & ' a K ) -> Result < Self , DecodeError > {
2305
2305
macro_rules! unwrap_obj {
@@ -2612,7 +2612,7 @@ mod tests {
2612
2612
use bitcoin:: secp256k1:: key:: { SecretKey , PublicKey } ;
2613
2613
use bitcoin:: secp256k1:: Secp256k1 ;
2614
2614
use std:: sync:: { Arc , Mutex } ;
2615
- use chain:: keysinterface:: InMemoryChannelKeys ;
2615
+ use chain:: keysinterface:: InMemoryChannelSigner ;
2616
2616
2617
2617
#[ test]
2618
2618
fn test_prune_preimages ( ) {
@@ -2668,7 +2668,7 @@ mod tests {
2668
2668
}
2669
2669
}
2670
2670
2671
- let keys = InMemoryChannelKeys :: new (
2671
+ let keys = InMemoryChannelSigner :: new (
2672
2672
& secp_ctx,
2673
2673
SecretKey :: from_slice ( & [ 41 ; 32 ] ) . unwrap ( ) ,
2674
2674
SecretKey :: from_slice ( & [ 41 ; 32 ] ) . unwrap ( ) ,
@@ -2818,7 +2818,7 @@ mod tests {
2818
2818
sign_input ! ( sighash_parts, idx, 0 , inp, sum_actual_sigs) ;
2819
2819
}
2820
2820
}
2821
- assert_eq ! ( base_weight + OnchainTxHandler :: <InMemoryChannelKeys >:: get_witnesses_weight( & inputs_des[ ..] ) , claim_tx. get_weight( ) + /* max_length_sig */ ( 73 * inputs_des. len( ) - sum_actual_sigs) ) ;
2821
+ assert_eq ! ( base_weight + OnchainTxHandler :: <InMemoryChannelSigner >:: get_witnesses_weight( & inputs_des[ ..] ) , claim_tx. get_weight( ) + /* max_length_sig */ ( 73 * inputs_des. len( ) - sum_actual_sigs) ) ;
2822
2822
2823
2823
// Claim tx with 1 offered HTLCs, 3 received HTLCs
2824
2824
claim_tx. input . clear ( ) ;
@@ -2842,7 +2842,7 @@ mod tests {
2842
2842
sign_input ! ( sighash_parts, idx, 0 , inp, sum_actual_sigs) ;
2843
2843
}
2844
2844
}
2845
- assert_eq ! ( base_weight + OnchainTxHandler :: <InMemoryChannelKeys >:: get_witnesses_weight( & inputs_des[ ..] ) , claim_tx. get_weight( ) + /* max_length_sig */ ( 73 * inputs_des. len( ) - sum_actual_sigs) ) ;
2845
+ assert_eq ! ( base_weight + OnchainTxHandler :: <InMemoryChannelSigner >:: get_witnesses_weight( & inputs_des[ ..] ) , claim_tx. get_weight( ) + /* max_length_sig */ ( 73 * inputs_des. len( ) - sum_actual_sigs) ) ;
2846
2846
2847
2847
// Justice tx with 1 revoked HTLC-Success tx output
2848
2848
claim_tx. input . clear ( ) ;
@@ -2864,7 +2864,7 @@ mod tests {
2864
2864
sign_input ! ( sighash_parts, idx, 0 , inp, sum_actual_sigs) ;
2865
2865
}
2866
2866
}
2867
- assert_eq ! ( base_weight + OnchainTxHandler :: <InMemoryChannelKeys >:: get_witnesses_weight( & inputs_des[ ..] ) , claim_tx. get_weight( ) + /* max_length_isg */ ( 73 * inputs_des. len( ) - sum_actual_sigs) ) ;
2867
+ assert_eq ! ( base_weight + OnchainTxHandler :: <InMemoryChannelSigner >:: get_witnesses_weight( & inputs_des[ ..] ) , claim_tx. get_weight( ) + /* max_length_isg */ ( 73 * inputs_des. len( ) - sum_actual_sigs) ) ;
2868
2868
}
2869
2869
2870
2870
// Further testing is done in the ChannelManager integration tests.
0 commit comments