Add new block `ConnectionStyle`s for `transaction_unconfirmed`
[rust-lightning] / lightning / src / ln / reorg_tests.rs
index 96fda526d68d2d46369b9c9ec831d96551e86112..616feb1eea1f6a14dddc7f876246976f49eaea01 100644 (file)
@@ -314,6 +314,11 @@ fn test_unconf_chan() {
        do_test_unconf_chan(false, true, false, ConnectStyle::BestBlockFirstSkippingBlocks);
        do_test_unconf_chan(true, false, false, ConnectStyle::BestBlockFirstSkippingBlocks);
        do_test_unconf_chan(false, false, false, ConnectStyle::BestBlockFirstSkippingBlocks);
+
+       do_test_unconf_chan(true, true, false, ConnectStyle::BestBlockFirstReorgsOnlyTip);
+       do_test_unconf_chan(false, true, false, ConnectStyle::BestBlockFirstReorgsOnlyTip);
+       do_test_unconf_chan(true, false, false, ConnectStyle::BestBlockFirstReorgsOnlyTip);
+       do_test_unconf_chan(false, false, false, ConnectStyle::BestBlockFirstReorgsOnlyTip);
 }
 
 #[test]
@@ -331,6 +336,11 @@ fn test_unconf_chan_via_funding_unconfirmed() {
        do_test_unconf_chan(true, false, true, ConnectStyle::BestBlockFirstSkippingBlocks);
        do_test_unconf_chan(false, false, true, ConnectStyle::BestBlockFirstSkippingBlocks);
 
+       do_test_unconf_chan(true, true, true, ConnectStyle::BestBlockFirstReorgsOnlyTip);
+       do_test_unconf_chan(false, true, true, ConnectStyle::BestBlockFirstReorgsOnlyTip);
+       do_test_unconf_chan(true, false, true, ConnectStyle::BestBlockFirstReorgsOnlyTip);
+       do_test_unconf_chan(false, false, true, ConnectStyle::BestBlockFirstReorgsOnlyTip);
+
        do_test_unconf_chan(true, true, true, ConnectStyle::FullBlockViaListen);
        do_test_unconf_chan(false, true, true, ConnectStyle::FullBlockViaListen);
        do_test_unconf_chan(true, false, true, ConnectStyle::FullBlockViaListen);
@@ -539,7 +549,9 @@ fn do_test_to_remote_after_local_detection(style: ConnectStyle) {
 fn test_to_remote_after_local_detection() {
        do_test_to_remote_after_local_detection(ConnectStyle::BestBlockFirst);
        do_test_to_remote_after_local_detection(ConnectStyle::BestBlockFirstSkippingBlocks);
+       do_test_to_remote_after_local_detection(ConnectStyle::BestBlockFirstReorgsOnlyTip);
        do_test_to_remote_after_local_detection(ConnectStyle::TransactionsFirst);
        do_test_to_remote_after_local_detection(ConnectStyle::TransactionsFirstSkippingBlocks);
+       do_test_to_remote_after_local_detection(ConnectStyle::TransactionsFirstReorgsOnlyTip);
        do_test_to_remote_after_local_detection(ConnectStyle::FullBlockViaListen);
 }