@@ -7925,15 +7925,15 @@ mod tests {
7925
7925
7926
7926
macro_rules! test_commitment {
7927
7927
( $counterparty_sig_hex: expr, $sig_hex: expr, $tx_hex: expr, $( $remain: tt) * ) => {
7928
- chan. context. channel_transaction_parameters. opt_anchors = None ;
7929
- test_commitment_common!( $counterparty_sig_hex, $sig_hex, $tx_hex, false , $( $remain) * ) ;
7928
+ chan. context. channel_transaction_parameters. channel_type_features = ChannelTypeFeatures :: only_static_remote_key ( ) ;
7929
+ test_commitment_common!( $counterparty_sig_hex, $sig_hex, $tx_hex, & ChannelTypeFeatures :: only_static_remote_key ( ) , $( $remain) * ) ;
7930
7930
} ;
7931
7931
}
7932
7932
7933
7933
macro_rules! test_commitment_with_anchors {
7934
7934
( $counterparty_sig_hex: expr, $sig_hex: expr, $tx_hex: expr, $( $remain: tt) * ) => {
7935
- chan. context. channel_transaction_parameters. opt_anchors = Some ( ( ) ) ;
7936
- test_commitment_common!( $counterparty_sig_hex, $sig_hex, $tx_hex, true , $( $remain) * ) ;
7935
+ chan. context. channel_transaction_parameters. channel_type_features = ChannelTypeFeatures :: static_remote_key_with_anchors ( ) ;
7936
+ test_commitment_common!( $counterparty_sig_hex, $sig_hex, $tx_hex, & ChannelTypeFeatures :: static_remote_key_with_anchors ( ) , $( $remain) * ) ;
7937
7937
} ;
7938
7938
}
7939
7939
@@ -7992,9 +7992,9 @@ mod tests {
7992
7992
let ref htlc = htlcs[ $htlc_idx] ;
7993
7993
let htlc_tx = chan_utils:: build_htlc_transaction( & unsigned_tx. txid, chan. context. feerate_per_kw,
7994
7994
chan. context. get_counterparty_selected_contest_delay( ) . unwrap( ) ,
7995
- & htlc, $opt_anchors, false , & keys. broadcaster_delayed_payment_key, & keys. revocation_key) ;
7995
+ & htlc, $opt_anchors, & keys. broadcaster_delayed_payment_key, & keys. revocation_key) ;
7996
7996
let htlc_redeemscript = chan_utils:: get_htlc_redeemscript( & htlc, $opt_anchors, & keys) ;
7997
- let htlc_sighashtype = if $opt_anchors { EcdsaSighashType :: SinglePlusAnyoneCanPay } else { EcdsaSighashType :: All } ;
7997
+ let htlc_sighashtype = if $opt_anchors. supports_anchors ( ) { EcdsaSighashType :: SinglePlusAnyoneCanPay } else { EcdsaSighashType :: All } ;
7998
7998
let htlc_sighash = Message :: from_slice( & sighash:: SighashCache :: new( & htlc_tx) . segwit_signature_hash( 0 , & htlc_redeemscript, htlc. amount_msat / 1000 , htlc_sighashtype) . unwrap( ) [ ..] ) . unwrap( ) ;
7999
7999
assert!( secp_ctx. verify_ecdsa( & htlc_sighash, & remote_signature, & keys. countersignatory_htlc_key) . is_ok( ) , "verify counterparty htlc sig" ) ;
8000
8000
@@ -8011,7 +8011,7 @@ mod tests {
8011
8011
}
8012
8012
8013
8013
let htlc_sig = htlc_sig_iter. next( ) . unwrap( ) ;
8014
- let num_anchors = if $opt_anchors { 2 } else { 0 } ;
8014
+ let num_anchors = if $opt_anchors. supports_anchors ( ) { 2 } else { 0 } ;
8015
8015
assert_eq!( ( htlc_sig. 0 ) . 0 . transaction_output_index, Some ( $htlc_idx + num_anchors) , "output index" ) ;
8016
8016
8017
8017
let signature = Signature :: from_der( & hex:: decode( $htlc_sig_hex) . unwrap( ) [ ..] ) . unwrap( ) ;
0 commit comments