Cleanup locally-selected-delay
[rust-lightning] / lightning / src / ln / functional_tests.rs
index 6a3fcfd33b5404b1338711dd3ce2d3a6c6787503..b11b57d34fa5ae802aed7c20fa6f3980c03dffaf 100644 (file)
@@ -1652,7 +1652,7 @@ fn test_fee_spike_violation_fails_htlc() {
        let local_commit_tx_output = TxOut {
                script_pubkey: chan_utils::get_revokeable_redeemscript(&commit_tx_keys.revocation_key,
                                                                               BREAKDOWN_TIMEOUT,
-                                                                              &commit_tx_keys.delayed_payment_key).to_v0_p2wsh(),
+                                                                              &commit_tx_keys.broadcaster_delayed_payment_key).to_v0_p2wsh(),
                                value: 95000,
        };
 
@@ -1704,7 +1704,7 @@ fn test_fee_spike_violation_fails_htlc() {
                let local_chan = local_chan_lock.by_id.get(&chan.2).unwrap();
                let local_chan_keys = local_chan.get_keys();
                let pre_commit_tx_keys = PreCalculatedTxCreationKeys::new(commit_tx_keys);
-               local_chan_keys.sign_remote_commitment(feerate_per_kw, &commit_tx, &pre_commit_tx_keys, &[&accepted_htlc_info], &secp_ctx).unwrap()
+               local_chan_keys.sign_counterparty_commitment(feerate_per_kw, &commit_tx, &pre_commit_tx_keys, &[&accepted_htlc_info], &secp_ctx).unwrap()
        };
 
        let commit_signed_msg = msgs::CommitmentSigned {
@@ -4217,8 +4217,8 @@ fn test_invalid_channel_announcement() {
 
        nodes[0].net_graph_msg_handler.handle_htlc_fail_channel_update(&msgs::HTLCFailChannelUpdate::ChannelClosed { short_channel_id : as_chan.get_short_channel_id().unwrap(), is_permanent: false } );
 
-       let as_bitcoin_key = as_chan.get_keys().inner.local_channel_pubkeys.funding_pubkey;
-       let bs_bitcoin_key = bs_chan.get_keys().inner.local_channel_pubkeys.funding_pubkey;
+       let as_bitcoin_key = as_chan.get_keys().inner.holder_channel_pubkeys.funding_pubkey;
+       let bs_bitcoin_key = bs_chan.get_keys().inner.holder_channel_pubkeys.funding_pubkey;
 
        let as_network_key = nodes[0].node.get_our_node_id();
        let bs_network_key = nodes[1].node.get_our_node_id();
@@ -4669,7 +4669,7 @@ macro_rules! check_spendable_outputs {
                                        Event::SpendableOutputs { ref outputs } => {
                                                for outp in outputs {
                                                        match *outp {
-                                                               SpendableOutputDescriptor::StaticOutputRemotePayment { ref outpoint, ref output, ref key_derivation_params } => {
+                                                               SpendableOutputDescriptor::StaticOutputCounterpartyPayment { ref outpoint, ref output, ref key_derivation_params } => {
                                                                        let input = TxIn {
                                                                                previous_output: outpoint.into_bitcoin_outpoint(),
                                                                                script_sig: Script::new(),
@@ -4697,7 +4697,7 @@ macro_rules! check_spendable_outputs {
                                                                        spend_tx.input[0].witness.push(remotepubkey.serialize().to_vec());
                                                                        txn.push(spend_tx);
                                                                },
-                                                               SpendableOutputDescriptor::DynamicOutputP2WSH { ref outpoint, ref per_commitment_point, ref to_self_delay, ref output, ref key_derivation_params, ref remote_revocation_pubkey } => {
+                                                               SpendableOutputDescriptor::DynamicOutputP2WSH { ref outpoint, ref per_commitment_point, ref to_self_delay, ref output, ref key_derivation_params, ref revocation_pubkey } => {
                                                                        let input = TxIn {
                                                                                previous_output: outpoint.into_bitcoin_outpoint(),
                                                                                script_sig: Script::new(),
@@ -4719,7 +4719,7 @@ macro_rules! check_spendable_outputs {
                                                                        if let Ok(delayed_payment_key) = chan_utils::derive_private_key(&secp_ctx, &per_commitment_point, &keys.inner.delayed_payment_base_key) {
 
                                                                                let delayed_payment_pubkey = PublicKey::from_secret_key(&secp_ctx, &delayed_payment_key);
-                                                                               let witness_script = chan_utils::get_revokeable_redeemscript(remote_revocation_pubkey, *to_self_delay, &delayed_payment_pubkey);
+                                                                               let witness_script = chan_utils::get_revokeable_redeemscript(revocation_pubkey, *to_self_delay, &delayed_payment_pubkey);
                                                                                let sighash = Message::from_slice(&bip143::SigHashCache::new(&spend_tx).signature_hash(0, &witness_script, output.value, SigHashType::All)[..]).unwrap();
                                                                                let local_delayedsig = secp_ctx.sign(&sighash, &delayed_payment_key);
                                                                                spend_tx.input[0].witness.push(local_delayedsig.serialize_der().to_vec());