Move `Channel::channel_id` and some other methods to `ChannelContext` impl
[rust-lightning] / lightning / src / ln / payment_tests.rs
index f514fa1ed97693733363ff8bfc8540e380efdf55..ab010b5a723b9057c6b119f40c03f6bb492133d7 100644 (file)
@@ -607,9 +607,9 @@ fn do_retry_with_no_persist(confirm_before_reload: bool) {
                let mut peer_state = per_peer_state.get(&nodes[2].node.get_our_node_id())
                        .unwrap().lock().unwrap();
                let mut channel = peer_state.channel_by_id.get_mut(&chan_id_2).unwrap();
-               let mut new_config = channel.config();
+               let mut new_config = channel.context.config();
                new_config.forwarding_fee_base_msat += 100_000;
-               channel.update_config(&new_config);
+               channel.context.update_config(&new_config);
                new_route.paths[0].hops[0].fee_msat += 100_000;
        }
 
@@ -1409,7 +1409,7 @@ fn test_trivial_inflight_htlc_tracking(){
                let chan_1_used_liquidity = inflight_htlcs.used_liquidity_msat(
                        &NodeId::from_pubkey(&nodes[0].node.get_our_node_id()) ,
                        &NodeId::from_pubkey(&nodes[1].node.get_our_node_id()),
-                       channel_1.get_short_channel_id().unwrap()
+                       channel_1.context.get_short_channel_id().unwrap()
                );
                assert_eq!(chan_1_used_liquidity, None);
        }
@@ -1421,7 +1421,7 @@ fn test_trivial_inflight_htlc_tracking(){
                let chan_2_used_liquidity = inflight_htlcs.used_liquidity_msat(
                        &NodeId::from_pubkey(&nodes[1].node.get_our_node_id()) ,
                        &NodeId::from_pubkey(&nodes[2].node.get_our_node_id()),
-                       channel_2.get_short_channel_id().unwrap()
+                       channel_2.context.get_short_channel_id().unwrap()
                );
 
                assert_eq!(chan_2_used_liquidity, None);
@@ -1446,7 +1446,7 @@ fn test_trivial_inflight_htlc_tracking(){
                let chan_1_used_liquidity = inflight_htlcs.used_liquidity_msat(
                        &NodeId::from_pubkey(&nodes[0].node.get_our_node_id()) ,
                        &NodeId::from_pubkey(&nodes[1].node.get_our_node_id()),
-                       channel_1.get_short_channel_id().unwrap()
+                       channel_1.context.get_short_channel_id().unwrap()
                );
                // First hop accounts for expected 1000 msat fee
                assert_eq!(chan_1_used_liquidity, Some(501000));
@@ -1459,7 +1459,7 @@ fn test_trivial_inflight_htlc_tracking(){
                let chan_2_used_liquidity = inflight_htlcs.used_liquidity_msat(
                        &NodeId::from_pubkey(&nodes[1].node.get_our_node_id()) ,
                        &NodeId::from_pubkey(&nodes[2].node.get_our_node_id()),
-                       channel_2.get_short_channel_id().unwrap()
+                       channel_2.context.get_short_channel_id().unwrap()
                );
 
                assert_eq!(chan_2_used_liquidity, Some(500000));
@@ -1485,7 +1485,7 @@ fn test_trivial_inflight_htlc_tracking(){
                let chan_1_used_liquidity = inflight_htlcs.used_liquidity_msat(
                        &NodeId::from_pubkey(&nodes[0].node.get_our_node_id()) ,
                        &NodeId::from_pubkey(&nodes[1].node.get_our_node_id()),
-                       channel_1.get_short_channel_id().unwrap()
+                       channel_1.context.get_short_channel_id().unwrap()
                );
                assert_eq!(chan_1_used_liquidity, None);
        }
@@ -1497,7 +1497,7 @@ fn test_trivial_inflight_htlc_tracking(){
                let chan_2_used_liquidity = inflight_htlcs.used_liquidity_msat(
                        &NodeId::from_pubkey(&nodes[1].node.get_our_node_id()) ,
                        &NodeId::from_pubkey(&nodes[2].node.get_our_node_id()),
-                       channel_2.get_short_channel_id().unwrap()
+                       channel_2.context.get_short_channel_id().unwrap()
                );
                assert_eq!(chan_2_used_liquidity, None);
        }
@@ -1538,7 +1538,7 @@ fn test_holding_cell_inflight_htlcs() {
                let used_liquidity = inflight_htlcs.used_liquidity_msat(
                        &NodeId::from_pubkey(&nodes[0].node.get_our_node_id()) ,
                        &NodeId::from_pubkey(&nodes[1].node.get_our_node_id()),
-                       channel.get_short_channel_id().unwrap()
+                       channel.context.get_short_channel_id().unwrap()
                );
 
                assert_eq!(used_liquidity, Some(2000000));