@@ -1338,9 +1338,9 @@ fn test_duplicate_htlc_different_direction_onchain() {
13381338 for e in events {
13391339 match e {
13401340 MessageSendEvent::BroadcastChannelUpdate { .. } => {},
1341- MessageSendEvent::HandleError { node_id, action: msgs::ErrorAction::SendErrorMessage { ref msg } } => {
1341+ MessageSendEvent::HandleError { node_id, action: msgs::ErrorAction::DisconnectPeer { ref msg } } => {
13421342 assert_eq!(node_id, nodes[1].node.get_our_node_id());
1343- assert_eq!(msg.data, "Channel closed because commitment or closing transaction was confirmed on chain.");
1343+ assert_eq!(msg.as_ref().unwrap(). data, "Channel closed because commitment or closing transaction was confirmed on chain.");
13441344 },
13451345 MessageSendEvent::UpdateHTLCs { ref node_id, updates: msgs::CommitmentUpdate { ref update_add_htlcs, ref update_fulfill_htlcs, ref update_fail_htlcs, ref update_fail_malformed_htlcs, .. } } => {
13461346 assert!(update_add_htlcs.is_empty());
@@ -2369,7 +2369,7 @@ fn channel_monitor_network_test() {
23692369 _ => panic!("Unexpected event"),
23702370 };
23712371 match events[1] {
2372- MessageSendEvent::HandleError { action: ErrorAction::SendErrorMessage { .. }, node_id } => {
2372+ MessageSendEvent::HandleError { action: ErrorAction::DisconnectPeer { .. }, node_id } => {
23732373 assert_eq!(node_id, nodes[4].node.get_our_node_id());
23742374 },
23752375 _ => panic!("Unexpected event"),
@@ -2401,7 +2401,7 @@ fn channel_monitor_network_test() {
24012401 _ => panic!("Unexpected event"),
24022402 };
24032403 match events[1] {
2404- MessageSendEvent::HandleError { action: ErrorAction::SendErrorMessage { .. }, node_id } => {
2404+ MessageSendEvent::HandleError { action: ErrorAction::DisconnectPeer { .. }, node_id } => {
24052405 assert_eq!(node_id, nodes[3].node.get_our_node_id());
24062406 },
24072407 _ => panic!("Unexpected event"),
@@ -2913,7 +2913,7 @@ fn test_htlc_on_chain_success() {
29132913 let nodes_0_event = remove_first_msg_event_to_node(&nodes[0].node.get_our_node_id(), &mut events);
29142914
29152915 match nodes_2_event {
2916- MessageSendEvent::HandleError { action: ErrorAction::SendErrorMessage { .. }, node_id: _ } => {},
2916+ MessageSendEvent::HandleError { action: ErrorAction::DisconnectPeer { .. }, node_id: _ } => {},
29172917 _ => panic!("Unexpected event"),
29182918 }
29192919
@@ -3358,7 +3358,7 @@ fn do_test_commitment_revoked_fail_backward_exhaustive(deliver_bs_raa: bool, use
33583358
33593359 let nodes_2_event = remove_first_msg_event_to_node(&nodes[2].node.get_our_node_id(), &mut events);
33603360 match nodes_2_event {
3361- MessageSendEvent::HandleError { action: ErrorAction::SendErrorMessage { msg: msgs::ErrorMessage { channel_id, ref data } }, node_id: _ } => {
3361+ MessageSendEvent::HandleError { action: ErrorAction::DisconnectPeer { msg: Some( msgs::ErrorMessage { channel_id, ref data }) }, node_id: _ } => {
33623362 assert_eq!(channel_id, chan_2.2);
33633363 assert_eq!(data.as_str(), "Channel closed because commitment or closing transaction was confirmed on chain.");
33643364 },
@@ -4920,7 +4920,7 @@ fn test_onchain_to_onchain_claim() {
49204920 let nodes_0_event = remove_first_msg_event_to_node(&nodes[0].node.get_our_node_id(), &mut msg_events);
49214921
49224922 match nodes_2_event {
4923- MessageSendEvent::HandleError { action: ErrorAction::SendErrorMessage { .. }, node_id: _ } => {},
4923+ MessageSendEvent::HandleError { action: ErrorAction::DisconnectPeer { .. }, node_id: _ } => {},
49244924 _ => panic!("Unexpected event"),
49254925 }
49264926
@@ -7860,9 +7860,9 @@ fn test_channel_conf_timeout() {
78607860 let close_ev = nodes[1].node.get_and_clear_pending_msg_events();
78617861 assert_eq!(close_ev.len(), 1);
78627862 match close_ev[0] {
7863- MessageSendEvent::HandleError { action: ErrorAction::SendErrorMessage { ref msg }, ref node_id } => {
7863+ MessageSendEvent::HandleError { action: ErrorAction::DisconnectPeer { ref msg }, ref node_id } => {
78647864 assert_eq!(*node_id, nodes[0].node.get_our_node_id());
7865- assert_eq!(msg.data, "Channel closed because funding transaction failed to confirm within 2016 blocks");
7865+ assert_eq!(msg.as_ref().unwrap(). data, "Channel closed because funding transaction failed to confirm within 2016 blocks");
78667866 },
78677867 _ => panic!("Unexpected event"),
78687868 }
@@ -9212,8 +9212,8 @@ fn test_invalid_funding_tx() {
92129212 assert_eq!(events_2.len(), 1);
92139213 if let MessageSendEvent::HandleError { node_id, action } = &events_2[0] {
92149214 assert_eq!(*node_id, nodes[0].node.get_our_node_id());
9215- if let msgs::ErrorAction::SendErrorMessage { msg } = action {
9216- assert_eq!(msg.data, "Channel closed because of an exception: ".to_owned() + expected_err);
9215+ if let msgs::ErrorAction::DisconnectPeer { msg } = action {
9216+ assert_eq!(msg.as_ref().unwrap(). data, "Channel closed because of an exception: ".to_owned() + expected_err);
92179217 } else { panic!(); }
92189218 } else { panic!(); }
92199219 assert_eq!(nodes[1].node.list_channels().len(), 0);
@@ -10652,7 +10652,7 @@ fn do_test_funding_and_commitment_tx_confirm_same_block(confirm_remote_commitmen
1065210652 let mut msg_events = closing_node.node.get_and_clear_pending_msg_events();
1065310653 assert_eq!(msg_events.len(), 1);
1065410654 match msg_events.pop().unwrap() {
10655- MessageSendEvent::HandleError { action: msgs::ErrorAction::SendErrorMessage { .. }, .. } => {},
10655+ MessageSendEvent::HandleError { action: msgs::ErrorAction::DisconnectPeer { .. }, .. } => {},
1065610656 _ => panic!("Unexpected event"),
1065710657 }
1065810658 check_added_monitors(closing_node, 1);
0 commit comments