@@ -17,7 +17,7 @@ use crate::chain::chaininterface::LowerBoundedFeeEstimator;
17
17
use crate::chain::channelmonitor;
18
18
use crate::chain::channelmonitor::{CLTV_CLAIM_BUFFER, LATENCY_GRACE_PERIOD_BLOCKS, ANTI_REORG_DELAY};
19
19
use crate::chain::transaction::OutPoint;
20
- use crate::sign::{ChannelSigner, EcdsaChannelSigner, EntropySource};
20
+ use crate::sign::{EcdsaChannelSigner, EntropySource};
21
21
use crate::events::{Event, MessageSendEvent, MessageSendEventsProvider, PathFailure, PaymentPurpose, ClosureReason, HTLCDestination, PaymentFailureReason};
22
22
use crate::ln::{PaymentPreimage, PaymentSecret, PaymentHash};
23
23
use crate::ln::channel::{commitment_tx_base_weight, COMMITMENT_TX_WEIGHT_PER_HTLC, CONCURRENT_INBOUND_HTLC_FEE_BUFFER, FEE_SPIKE_BUFFER_FEE_INCREASE_MULTIPLE, MIN_AFFORDABLE_HTLC_COUNT, get_holder_selected_channel_reserve_satoshis, OutboundV1Channel, InboundV1Channel};
@@ -703,7 +703,7 @@ fn test_update_fee_that_funder_cannot_afford() {
703
703
let chan_lock = per_peer_state.get(&nodes[1].node.get_our_node_id()).unwrap().lock().unwrap();
704
704
let local_chan = chan_lock.channel_by_id.get(&chan.2).unwrap();
705
705
let chan_signer = local_chan.get_signer();
706
- let pubkeys = chan_signer.pubkeys();
706
+ let pubkeys = chan_signer.as_ref(). pubkeys();
707
707
(pubkeys.revocation_basepoint, pubkeys.htlc_basepoint,
708
708
pubkeys.funding_pubkey)
709
709
};
@@ -712,9 +712,9 @@ fn test_update_fee_that_funder_cannot_afford() {
712
712
let chan_lock = per_peer_state.get(&nodes[0].node.get_our_node_id()).unwrap().lock().unwrap();
713
713
let remote_chan = chan_lock.channel_by_id.get(&chan.2).unwrap();
714
714
let chan_signer = remote_chan.get_signer();
715
- let pubkeys = chan_signer.pubkeys();
715
+ let pubkeys = chan_signer.as_ref(). pubkeys();
716
716
(pubkeys.delayed_payment_basepoint, pubkeys.htlc_basepoint,
717
- chan_signer.get_per_commitment_point(INITIAL_COMMITMENT_NUMBER - 1, &secp_ctx),
717
+ chan_signer.as_ref(). get_per_commitment_point(INITIAL_COMMITMENT_NUMBER - 1, &secp_ctx),
718
718
pubkeys.funding_pubkey)
719
719
};
720
720
@@ -738,7 +738,7 @@ fn test_update_fee_that_funder_cannot_afford() {
738
738
&mut htlcs,
739
739
&local_chan.context.channel_transaction_parameters.as_counterparty_broadcastable()
740
740
);
741
- local_chan_signer.sign_counterparty_commitment(&commitment_tx, Vec::new(), &secp_ctx).unwrap()
741
+ local_chan_signer.as_ecdsa().unwrap(). sign_counterparty_commitment(&commitment_tx, Vec::new(), &secp_ctx).unwrap()
742
742
};
743
743
744
744
let commit_signed_msg = msgs::CommitmentSigned {
@@ -1416,23 +1416,23 @@ fn test_fee_spike_violation_fails_htlc() {
1416
1416
let local_chan = chan_lock.channel_by_id.get(&chan.2).unwrap();
1417
1417
let chan_signer = local_chan.get_signer();
1418
1418
// Make the signer believe we validated another commitment, so we can release the secret
1419
- chan_signer.get_enforcement_state().last_holder_commitment -= 1;
1419
+ chan_signer.as_ecdsa().unwrap(). get_enforcement_state().last_holder_commitment -= 1;
1420
1420
1421
- let pubkeys = chan_signer.pubkeys();
1421
+ let pubkeys = chan_signer.as_ref(). pubkeys();
1422
1422
(pubkeys.revocation_basepoint, pubkeys.htlc_basepoint,
1423
- chan_signer.release_commitment_secret(INITIAL_COMMITMENT_NUMBER),
1424
- chan_signer.get_per_commitment_point(INITIAL_COMMITMENT_NUMBER - 2, &secp_ctx),
1425
- chan_signer.pubkeys().funding_pubkey)
1423
+ chan_signer.as_ref(). release_commitment_secret(INITIAL_COMMITMENT_NUMBER),
1424
+ chan_signer.as_ref(). get_per_commitment_point(INITIAL_COMMITMENT_NUMBER - 2, &secp_ctx),
1425
+ chan_signer.as_ref(). pubkeys().funding_pubkey)
1426
1426
};
1427
1427
let (remote_delayed_payment_basepoint, remote_htlc_basepoint, remote_point, remote_funding) = {
1428
1428
let per_peer_state = nodes[1].node.per_peer_state.read().unwrap();
1429
1429
let chan_lock = per_peer_state.get(&nodes[0].node.get_our_node_id()).unwrap().lock().unwrap();
1430
1430
let remote_chan = chan_lock.channel_by_id.get(&chan.2).unwrap();
1431
1431
let chan_signer = remote_chan.get_signer();
1432
- let pubkeys = chan_signer.pubkeys();
1432
+ let pubkeys = chan_signer.as_ref(). pubkeys();
1433
1433
(pubkeys.delayed_payment_basepoint, pubkeys.htlc_basepoint,
1434
- chan_signer.get_per_commitment_point(INITIAL_COMMITMENT_NUMBER - 1, &secp_ctx),
1435
- chan_signer.pubkeys().funding_pubkey)
1434
+ chan_signer.as_ref(). get_per_commitment_point(INITIAL_COMMITMENT_NUMBER - 1, &secp_ctx),
1435
+ chan_signer.as_ref(). pubkeys().funding_pubkey)
1436
1436
};
1437
1437
1438
1438
// Assemble the set of keys we can use for signatures for our commitment_signed message.
@@ -1468,7 +1468,7 @@ fn test_fee_spike_violation_fails_htlc() {
1468
1468
&mut vec![(accepted_htlc_info, ())],
1469
1469
&local_chan.context.channel_transaction_parameters.as_counterparty_broadcastable()
1470
1470
);
1471
- local_chan_signer.sign_counterparty_commitment(&commitment_tx, Vec::new(), &secp_ctx).unwrap()
1471
+ local_chan_signer.as_ecdsa().unwrap(). sign_counterparty_commitment(&commitment_tx, Vec::new(), &secp_ctx).unwrap()
1472
1472
};
1473
1473
1474
1474
let commit_signed_msg = msgs::CommitmentSigned {
@@ -6965,7 +6965,7 @@ fn test_user_configurable_csv_delay() {
6965
6965
6966
6966
// We test config.our_to_self > BREAKDOWN_TIMEOUT is enforced in OutboundV1Channel::new()
6967
6967
if let Err(error) = OutboundV1Channel::new(&LowerBoundedFeeEstimator::new(&test_utils::TestFeeEstimator { sat_per_kw: Mutex::new(253) }),
6968
- &nodes[0].keys_manager, & nodes[0].keys_manager, nodes[1].node.get_our_node_id(), &nodes[1].node.init_features(), 1000000, 1000000, 0,
6968
+ &nodes[0].keys_manager, nodes[0].keys_manager, nodes[1].node.get_our_node_id(), &nodes[1].node.init_features(), 1000000, 1000000, 0,
6969
6969
&low_our_to_self_config, 0, 42)
6970
6970
{
6971
6971
match error {
@@ -6979,7 +6979,7 @@ fn test_user_configurable_csv_delay() {
6979
6979
let mut open_channel = get_event_msg!(nodes[1], MessageSendEvent::SendOpenChannel, nodes[0].node.get_our_node_id());
6980
6980
open_channel.to_self_delay = 200;
6981
6981
if let Err(error) = InboundV1Channel::new(&LowerBoundedFeeEstimator::new(&test_utils::TestFeeEstimator { sat_per_kw: Mutex::new(253) }),
6982
- &nodes[0].keys_manager, & nodes[0].keys_manager, nodes[1].node.get_our_node_id(), &nodes[0].node.channel_type_features(), &nodes[1].node.init_features(), &open_channel, 0,
6982
+ &nodes[0].keys_manager, nodes[0].keys_manager, nodes[1].node.get_our_node_id(), &nodes[0].node.channel_type_features(), &nodes[1].node.init_features(), &open_channel, 0,
6983
6983
&low_our_to_self_config, 0, &nodes[0].logger, 42)
6984
6984
{
6985
6985
match error {
@@ -7011,7 +7011,7 @@ fn test_user_configurable_csv_delay() {
7011
7011
let mut open_channel = get_event_msg!(nodes[1], MessageSendEvent::SendOpenChannel, nodes[0].node.get_our_node_id());
7012
7012
open_channel.to_self_delay = 200;
7013
7013
if let Err(error) = InboundV1Channel::new(&LowerBoundedFeeEstimator::new(&test_utils::TestFeeEstimator { sat_per_kw: Mutex::new(253) }),
7014
- &nodes[0].keys_manager, & nodes[0].keys_manager, nodes[1].node.get_our_node_id(), &nodes[0].node.channel_type_features(), &nodes[1].node.init_features(), &open_channel, 0,
7014
+ &nodes[0].keys_manager, nodes[0].keys_manager, nodes[1].node.get_our_node_id(), &nodes[0].node.channel_type_features(), &nodes[1].node.init_features(), &open_channel, 0,
7015
7015
&high_their_to_self_config, 0, &nodes[0].logger, 42)
7016
7016
{
7017
7017
match error {
@@ -7559,16 +7559,16 @@ fn test_counterparty_raa_skip_no_crash() {
7559
7559
const INITIAL_COMMITMENT_NUMBER: u64 = (1 << 48) - 1;
7560
7560
7561
7561
// Make signer believe we got a counterparty signature, so that it allows the revocation
7562
- keys.get_enforcement_state().last_holder_commitment -= 1;
7563
- per_commitment_secret = keys.release_commitment_secret(INITIAL_COMMITMENT_NUMBER);
7562
+ keys.as_ecdsa().unwrap(). get_enforcement_state().last_holder_commitment -= 1;
7563
+ per_commitment_secret = keys.as_ref(). release_commitment_secret(INITIAL_COMMITMENT_NUMBER);
7564
7564
7565
7565
// Must revoke without gaps
7566
- keys.get_enforcement_state().last_holder_commitment -= 1;
7567
- keys.release_commitment_secret(INITIAL_COMMITMENT_NUMBER - 1);
7566
+ keys.as_ecdsa().unwrap(). get_enforcement_state().last_holder_commitment -= 1;
7567
+ keys.as_ref(). release_commitment_secret(INITIAL_COMMITMENT_NUMBER - 1);
7568
7568
7569
- keys.get_enforcement_state().last_holder_commitment -= 1;
7569
+ keys.as_ecdsa().unwrap(). get_enforcement_state().last_holder_commitment -= 1;
7570
7570
next_per_commitment_point = PublicKey::from_secret_key(&Secp256k1::new(),
7571
- &SecretKey::from_slice(&keys.release_commitment_secret(INITIAL_COMMITMENT_NUMBER - 2)).unwrap());
7571
+ &SecretKey::from_slice(&keys.as_ref(). release_commitment_secret(INITIAL_COMMITMENT_NUMBER - 2)).unwrap());
7572
7572
}
7573
7573
7574
7574
nodes[1].node.handle_revoke_and_ack(&nodes[0].node.get_our_node_id(),
0 commit comments