X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fasync_signer_tests.rs;h=4342886f37e342e983e1901b415557f6501409e4;hb=1e580668684d4dbf11d69d75e5d4a5c4f8cc40bf;hp=613df570d4e3bf40051d25e59a5d6fa45823dbdb;hpb=2c9dbb959d0c16ee97baf70074d0a31a0c0443e8;p=rust-lightning diff --git a/lightning/src/ln/async_signer_tests.rs b/lightning/src/ln/async_signer_tests.rs index 613df570..4342886f 100644 --- a/lightning/src/ln/async_signer_tests.rs +++ b/lightning/src/ln/async_signer_tests.rs @@ -12,6 +12,7 @@ use bitcoin::{Transaction, TxOut, TxIn, Amount}; use bitcoin::blockdata::locktime::absolute::LockTime; +use bitcoin::transaction::Version; use crate::chain::channelmonitor::LATENCY_GRACE_PERIOD_BLOCKS; use crate::events::bump_transaction::WalletSource; @@ -344,12 +345,12 @@ fn do_test_async_holder_signatures(anchors: bool, remote_commitment: bool) { let closing_node = if remote_commitment { &nodes[1] } else { &nodes[0] }; let coinbase_tx = Transaction { - version: 2, + version: Version::TWO, lock_time: LockTime::ZERO, input: vec![TxIn { ..Default::default() }], output: vec![ TxOut { - value: Amount::ONE_BTC.to_sat(), + value: Amount::ONE_BTC, script_pubkey: closing_node.wallet_source.get_change_script().unwrap(), }, ], @@ -363,12 +364,13 @@ fn do_test_async_holder_signatures(anchors: bool, remote_commitment: bool) { // Route an HTLC and set the signer as unavailable. let (_, _, chan_id, funding_tx) = create_announced_chan_between_nodes(&nodes, 0, 1); route_payment(&nodes[0], &[&nodes[1]], 1_000_000); + let error_message = "Channel force-closed"; nodes[0].set_channel_signer_available(&nodes[1].node.get_our_node_id(), &chan_id, false); if remote_commitment { // Make the counterparty broadcast its latest commitment. - nodes[1].node.force_close_broadcasting_latest_txn(&chan_id, &nodes[0].node.get_our_node_id()).unwrap(); + nodes[1].node.force_close_broadcasting_latest_txn(&chan_id, &nodes[0].node.get_our_node_id(), error_message.to_string()).unwrap(); check_added_monitors(&nodes[1], 1); check_closed_broadcast(&nodes[1], 1, true); check_closed_event(&nodes[1], 1, ClosureReason::HolderForceClosed, false, &[nodes[0].node.get_our_node_id()], 100_000);