Implement Display for ShutdownScript
[rust-lightning] / lightning / src / ln / functional_tests.rs
index 21f871fa8d3376405c973e3cd4b7a5607a368171..0f47ef63a79c36b997bad4d3a3ef5c02a6aac477 100644 (file)
@@ -7542,7 +7542,7 @@ fn test_unsupported_anysegwit_upfront_shutdown_script() {
        match events[0] {
                MessageSendEvent::HandleError { action: ErrorAction::SendErrorMessage { ref msg }, node_id } => {
                        assert_eq!(node_id, nodes[0].node.get_our_node_id());
-                       assert!(regex::Regex::new(r"Peer is signaling upfront_shutdown but has provided a non-accepted scriptpubkey format. script: (\([A-Fa-f0-9]+\))").unwrap().is_match(&*msg.data));
+                       assert_eq!(msg.data, "Peer is signaling upfront_shutdown but has provided a non-accepted scriptpubkey format: Script(OP_PUSHNUM_16 OP_PUSHBYTES_2 0028)");
                },
                _ => panic!("Unexpected event"),
        }
@@ -7560,7 +7560,7 @@ fn test_unsupported_anysegwit_upfront_shutdown_script() {
        match events[0] {
                MessageSendEvent::HandleError { action: ErrorAction::SendErrorMessage { ref msg }, node_id } => {
                        assert_eq!(node_id, nodes[1].node.get_our_node_id());
-                       assert!(regex::Regex::new(r"Peer is signaling upfront_shutdown but has provided a non-accepted scriptpubkey format. script: (\([A-Fa-f0-9]+\))").unwrap().is_match(&*msg.data));
+                       assert_eq!(msg.data, "Peer is signaling upfront_shutdown but has provided a non-accepted scriptpubkey format: Script(OP_PUSHNUM_16 OP_PUSHBYTES_2 0028)");
                },
                _ => panic!("Unexpected event"),
        }
@@ -7587,7 +7587,7 @@ fn test_invalid_upfront_shutdown_script() {
        match events[0] {
                MessageSendEvent::HandleError { action: ErrorAction::SendErrorMessage { ref msg }, node_id } => {
                        assert_eq!(node_id, nodes[0].node.get_our_node_id());
-                       assert!(regex::Regex::new(r"Peer is signaling upfront_shutdown but has provided a non-accepted scriptpubkey format. script: (\([A-Fa-f0-9]+\))").unwrap().is_match(&*msg.data));
+                       assert_eq!(msg.data, "Peer is signaling upfront_shutdown but has provided a non-accepted scriptpubkey format: Script(OP_0 OP_PUSHBYTES_2 0000)");
                },
                _ => panic!("Unexpected event"),
        }
@@ -7749,7 +7749,7 @@ fn test_user_configurable_csv_delay() {
        let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
 
        // We test config.our_to_self > BREAKDOWN_TIMEOUT is enforced in Channel::new_outbound()
-       if let Err(error) = Channel::new_outbound(&&test_utils::TestFeeEstimator { sat_per_kw: Mutex::new(253) }, &nodes[0].keys_manager, nodes[1].node.get_our_node_id(), 1000000, 1000000, 0, &low_our_to_self_config) {
+       if let Err(error) = Channel::new_outbound(&&test_utils::TestFeeEstimator { sat_per_kw: Mutex::new(253) }, &nodes[0].keys_manager, nodes[1].node.get_our_node_id(), InitFeatures::known(), 1000000, 1000000, 0, &low_our_to_self_config) {
                match error {
                        APIError::APIMisuseError { err } => { assert!(regex::Regex::new(r"Configured with an unreasonable our_to_self_delay \(\d+\) putting user funds at risks").unwrap().is_match(err.as_str())); },
                        _ => panic!("Unexpected event"),