]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Split up channel_monitor_network_test a little bit 2018-11-monitor-test-split
authorMatt Corallo <git@bluematt.me>
Fri, 9 Nov 2018 04:31:53 +0000 (15:01 +1030)
committerMatt Corallo <git@bluematt.me>
Fri, 9 Nov 2018 04:31:53 +0000 (15:01 +1030)
src/ln/channelmanager.rs

index 8d31c3347f2d285f3b4eaa6ac50d2ae7b3025c3b..e43b68566c25d6b1c8808b5dcc6e95de66f41f20 100644 (file)
@@ -5708,7 +5708,13 @@ mod tests {
                get_announce_close_broadcast_events(&nodes, 3, 4);
                assert_eq!(nodes[3].node.list_channels().len(), 0);
                assert_eq!(nodes[4].node.list_channels().len(), 0);
+       }
+
+       #[test]
+       fn test_justice_tx() {
+               // Test justice txn built on revoked HTLC-Success tx, against both sides
 
+               let nodes = create_network(2);
                // Create some new channels:
                let chan_5 = create_announced_chan_between_nodes(&nodes, 0, 1);
 
@@ -5748,6 +5754,9 @@ mod tests {
                }
                get_announce_close_broadcast_events(&nodes, 0, 1);
 
+               assert_eq!(nodes[0].node.list_channels().len(), 0);
+               assert_eq!(nodes[1].node.list_channels().len(), 0);
+
                // We test justice_tx build by A on B's revoked HTLC-Success tx
                // Create some new channels:
                let chan_6 = create_announced_chan_between_nodes(&nodes, 0, 1);