Test that Persist temp and perm failures behave as expected.
[rust-lightning] / lightning / src / ln / functional_test_utils.rs
index 0a7519ea92898f883c385cc3876e0a90a8c6ac87..bf2e78996f4afcc0175d83947408a243fe4073c0 100644 (file)
@@ -198,7 +198,7 @@ impl<'a, 'b, 'c> Drop for Node<'a, 'b, 'c> {
                                }).unwrap();
                        }
 
-                       let persister = test_utils::TestPersister{};
+                       let persister = test_utils::TestPersister::new();
                        let chain_source = test_utils::TestChainSource::new(Network::Testnet);
                        let chain_monitor = test_utils::TestChainMonitor::new(Some(&chain_source), self.tx_broadcaster.clone(), &self.logger, &feeest, &persister);
                        for deserialized_monitor in deserialized_monitors.drain(..) {
@@ -249,6 +249,8 @@ macro_rules! get_revoke_commit_msgs {
        }
 }
 
+/// Get an specific event message from the pending events queue.
+#[macro_export]
 macro_rules! get_event_msg {
        ($node: expr, $event_type: path, $node_id: expr) => {
                {
@@ -310,6 +312,8 @@ macro_rules! get_local_commitment_txn {
        }
 }
 
+/// Check the error from attempting a payment.
+#[macro_export]
 macro_rules! unwrap_send_err {
        ($res: expr, $all_failed: expr, $type: pat, $check: expr) => {
                match &$res {
@@ -760,6 +764,8 @@ macro_rules! commitment_signed_dance {
        }
 }
 
+/// Get a payment preimage and hash.
+#[macro_export]
 macro_rules! get_payment_preimage_hash {
        ($node: expr) => {
                {
@@ -1117,7 +1123,7 @@ pub fn create_chanmon_cfgs(node_count: usize) -> Vec<TestChanMonCfg> {
                let fee_estimator = test_utils::TestFeeEstimator { sat_per_kw: 253 };
                let chain_source = test_utils::TestChainSource::new(Network::Testnet);
                let logger = test_utils::TestLogger::with_id(format!("node {}", i));
-               let persister = test_utils::TestPersister{};
+               let persister = test_utils::TestPersister::new();
                chan_mon_cfgs.push(TestChanMonCfg{ tx_broadcaster, fee_estimator, chain_source, logger, persister });
        }