X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Freload_tests.rs;h=a490b145e4b79652e09caf282a46037c7d3175a8;hb=d17e759d021c90abcbc7b3b433943d29e3c60724;hp=4422af1e8c70c63a81b93ece1aac38e2553d00a0;hpb=a36b529752778f519b27e62582d1b2a758ce48d6;p=rust-lightning diff --git a/lightning/src/ln/reload_tests.rs b/lightning/src/ln/reload_tests.rs index 4422af1e..a490b145 100644 --- a/lightning/src/ln/reload_tests.rs +++ b/lightning/src/ln/reload_tests.rs @@ -27,7 +27,6 @@ use crate::util::config::UserConfig; use bitcoin::hash_types::BlockHash; use crate::prelude::*; -use core::default::Default; use crate::sync::Mutex; use crate::ln::functional_test_utils::*; @@ -412,7 +411,7 @@ fn test_manager_serialize_deserialize_inconsistent_monitor() { } let mut nodes_0_read = &nodes_0_serialized[..]; - if let Err(msgs::DecodeError::InvalidValue) = + if let Err(msgs::DecodeError::DangerousValue) = <(BlockHash, ChannelManager<&test_utils::TestChainMonitor, &test_utils::TestBroadcaster, &test_utils::TestKeysInterface, &test_utils::TestKeysInterface, &test_utils::TestKeysInterface, &test_utils::TestFeeEstimator, &test_utils::TestRouter, &test_utils::TestLogger>)>::read(&mut nodes_0_read, ChannelManagerReadArgs { default_config: UserConfig::default(), entropy_source: keys_manager, @@ -628,9 +627,10 @@ fn do_test_data_loss_protect(reconnect_panicing: bool, substantially_old: bool, std::mem::forget(nodes); } } else { + let error_message = "Channel force-closed"; assert!(!not_stale, "We only care about the stale case when not testing panicking"); - nodes[0].node.force_close_without_broadcasting_txn(&chan.2, &nodes[1].node.get_our_node_id()).unwrap(); + nodes[0].node.force_close_without_broadcasting_txn(&chan.2, &nodes[1].node.get_our_node_id(), error_message.to_string()).unwrap(); check_added_monitors!(nodes[0], 1); check_closed_event!(nodes[0], 1, ClosureReason::HolderForceClosed, [nodes[1].node.get_our_node_id()], 1000000); { @@ -1025,8 +1025,9 @@ fn do_forwarded_payment_no_manager_persistence(use_cs_commitment: bool, claim_ht assert!(nodes[2].tx_broadcaster.txn_broadcasted.lock().unwrap().is_empty()); let _ = nodes[2].node.get_and_clear_pending_msg_events(); + let error_message = "Channel force-closed"; - nodes[2].node.force_close_broadcasting_latest_txn(&chan_id_2, &nodes[1].node.get_our_node_id()).unwrap(); + nodes[2].node.force_close_broadcasting_latest_txn(&chan_id_2, &nodes[1].node.get_our_node_id(), error_message.to_string()).unwrap(); let cs_commitment_tx = nodes[2].tx_broadcaster.txn_broadcasted.lock().unwrap().split_off(0); assert_eq!(cs_commitment_tx.len(), if claim_htlc { 2 } else { 1 });