@@ -513,7 +513,7 @@ mod tests {
513
513
proportional_millionths : 0
514
514
} ;
515
515
network. add_node ( node1. clone ( ) , NodeInfo {
516
- channels : vec ! ( NetworkGraph :: get_key ( 1 , zero_hash . clone ( ) ) , NetworkGraph :: get_key ( 3 , zero_hash . clone ( ) ) ) ,
516
+ channels : vec ! ( 1 , 3 ) ,
517
517
lowest_inbound_channel_fees : Some ( lowest_routing_fees) ,
518
518
features : NodeFeatures :: from_le_bytes ( id_to_feature_flags ! ( 1 ) ) ,
519
519
last_update : Some ( 1 ) ,
@@ -522,7 +522,7 @@ mod tests {
522
522
addresses : Vec :: new ( ) ,
523
523
announcement_message : None ,
524
524
} ) ;
525
- network. add_channel ( NetworkGraph :: get_key ( 1 , zero_hash . clone ( ) ) , ChannelInfo {
525
+ network. add_channel ( 1 , ChannelInfo {
526
526
features : ChannelFeatures :: from_le_bytes ( id_to_feature_flags ! ( 1 ) ) ,
527
527
one_to_two : DirectionalChannelInfo {
528
528
src_node_id : our_id. clone ( ) ,
@@ -551,7 +551,7 @@ mod tests {
551
551
proportional_millionths : 0
552
552
} ;
553
553
network. add_node ( node2. clone ( ) , NodeInfo {
554
- channels : vec ! ( NetworkGraph :: get_key ( 2 , zero_hash . clone ( ) ) , NetworkGraph :: get_key ( 4 , zero_hash . clone ( ) ) ) ,
554
+ channels : vec ! ( 2 , 4 ) ,
555
555
lowest_inbound_channel_fees : Some ( routing_fees. clone ( ) ) ,
556
556
features : NodeFeatures :: from_le_bytes ( id_to_feature_flags ! ( 2 ) ) ,
557
557
last_update : Some ( 1 ) ,
@@ -560,7 +560,7 @@ mod tests {
560
560
addresses : Vec :: new ( ) ,
561
561
announcement_message : None ,
562
562
} ) ;
563
- network. add_channel ( NetworkGraph :: get_key ( 2 , zero_hash . clone ( ) ) , ChannelInfo {
563
+ network. add_channel ( 2 , ChannelInfo {
564
564
features : ChannelFeatures :: from_le_bytes ( id_to_feature_flags ! ( 2 ) ) ,
565
565
one_to_two : DirectionalChannelInfo {
566
566
src_node_id : our_id. clone ( ) ,
@@ -585,7 +585,7 @@ mod tests {
585
585
announcement_message : None ,
586
586
} ) ;
587
587
network. add_node ( node8. clone ( ) , NodeInfo {
588
- channels : vec ! ( NetworkGraph :: get_key ( 12 , zero_hash . clone ( ) ) , NetworkGraph :: get_key ( 13 , zero_hash . clone ( ) ) ) ,
588
+ channels : vec ! ( 12 , 13 ) ,
589
589
lowest_inbound_channel_fees : Some ( routing_fees. clone ( ) ) ,
590
590
features : NodeFeatures :: from_le_bytes ( id_to_feature_flags ! ( 8 ) ) ,
591
591
last_update : Some ( 1 ) ,
@@ -594,7 +594,7 @@ mod tests {
594
594
addresses : Vec :: new ( ) ,
595
595
announcement_message : None ,
596
596
} ) ;
597
- network. add_channel ( NetworkGraph :: get_key ( 12 , zero_hash . clone ( ) ) , ChannelInfo {
597
+ network. add_channel ( 12 , ChannelInfo {
598
598
features : ChannelFeatures :: from_le_bytes ( id_to_feature_flags ! ( 12 ) ) ,
599
599
one_to_two : DirectionalChannelInfo {
600
600
src_node_id : our_id. clone ( ) ,
@@ -620,12 +620,12 @@ mod tests {
620
620
} ) ;
621
621
network. add_node ( node3. clone ( ) , NodeInfo {
622
622
channels : vec ! (
623
- NetworkGraph :: get_key ( 3 , zero_hash . clone ( ) ) ,
624
- NetworkGraph :: get_key ( 4 , zero_hash . clone ( ) ) ,
625
- NetworkGraph :: get_key ( 13 , zero_hash . clone ( ) ) ,
626
- NetworkGraph :: get_key ( 5 , zero_hash . clone ( ) ) ,
627
- NetworkGraph :: get_key ( 6 , zero_hash . clone ( ) ) ,
628
- NetworkGraph :: get_key ( 7 , zero_hash . clone ( ) ) ) ,
623
+ 3 ,
624
+ 4 ,
625
+ 13 ,
626
+ 5 ,
627
+ 6 ,
628
+ 7 ) ,
629
629
lowest_inbound_channel_fees : Some ( routing_fees. clone ( ) ) ,
630
630
features : NodeFeatures :: from_le_bytes ( id_to_feature_flags ! ( 3 ) ) ,
631
631
last_update : Some ( 1 ) ,
@@ -634,7 +634,7 @@ mod tests {
634
634
addresses : Vec :: new ( ) ,
635
635
announcement_message : None ,
636
636
} ) ;
637
- network. add_channel ( NetworkGraph :: get_key ( 3 , zero_hash . clone ( ) ) , ChannelInfo {
637
+ network. add_channel ( 3 , ChannelInfo {
638
638
features : ChannelFeatures :: from_le_bytes ( id_to_feature_flags ! ( 3 ) ) ,
639
639
one_to_two : DirectionalChannelInfo {
640
640
src_node_id : node1. clone ( ) ,
@@ -658,7 +658,7 @@ mod tests {
658
658
} ,
659
659
announcement_message : None ,
660
660
} ) ;
661
- network. add_channel ( NetworkGraph :: get_key ( 4 , zero_hash . clone ( ) ) , ChannelInfo {
661
+ network. add_channel ( 4 , ChannelInfo {
662
662
features : ChannelFeatures :: from_le_bytes ( id_to_feature_flags ! ( 4 ) ) ,
663
663
one_to_two : DirectionalChannelInfo {
664
664
src_node_id : node2. clone ( ) ,
@@ -682,7 +682,7 @@ mod tests {
682
682
} ,
683
683
announcement_message : None ,
684
684
} ) ;
685
- network. add_channel ( NetworkGraph :: get_key ( 13 , zero_hash . clone ( ) ) , ChannelInfo {
685
+ network. add_channel ( 13 , ChannelInfo {
686
686
features : ChannelFeatures :: from_le_bytes ( id_to_feature_flags ! ( 13 ) ) ,
687
687
one_to_two : DirectionalChannelInfo {
688
688
src_node_id : node8. clone ( ) ,
@@ -707,7 +707,7 @@ mod tests {
707
707
announcement_message : None ,
708
708
} ) ;
709
709
network. add_node ( node4. clone ( ) , NodeInfo {
710
- channels : vec ! ( NetworkGraph :: get_key ( 5 , zero_hash . clone ( ) ) , NetworkGraph :: get_key ( 11 , zero_hash . clone ( ) ) ) ,
710
+ channels : vec ! ( 5 , 11 ) ,
711
711
lowest_inbound_channel_fees : Some ( routing_fees. clone ( ) ) ,
712
712
features : NodeFeatures :: from_le_bytes ( id_to_feature_flags ! ( 4 ) ) ,
713
713
last_update : Some ( 1 ) ,
@@ -716,7 +716,7 @@ mod tests {
716
716
addresses : Vec :: new ( ) ,
717
717
announcement_message : None ,
718
718
} ) ;
719
- network. add_channel ( NetworkGraph :: get_key ( 5 , zero_hash . clone ( ) ) , ChannelInfo {
719
+ network. add_channel ( 5 , ChannelInfo {
720
720
features : ChannelFeatures :: from_le_bytes ( id_to_feature_flags ! ( 5 ) ) ,
721
721
one_to_two : DirectionalChannelInfo {
722
722
src_node_id : node3. clone ( ) ,
@@ -741,7 +741,7 @@ mod tests {
741
741
announcement_message : None ,
742
742
} ) ;
743
743
network. add_node ( node5. clone ( ) , NodeInfo {
744
- channels : vec ! ( NetworkGraph :: get_key ( 6 , zero_hash . clone ( ) ) , NetworkGraph :: get_key ( 11 , zero_hash . clone ( ) ) ) ,
744
+ channels : vec ! ( 6 , 11 ) ,
745
745
lowest_inbound_channel_fees : Some ( routing_fees. clone ( ) ) ,
746
746
features : NodeFeatures :: from_le_bytes ( id_to_feature_flags ! ( 5 ) ) ,
747
747
last_update : Some ( 1 ) ,
@@ -750,7 +750,7 @@ mod tests {
750
750
addresses : Vec :: new ( ) ,
751
751
announcement_message : None ,
752
752
} ) ;
753
- network. add_channel ( NetworkGraph :: get_key ( 6 , zero_hash . clone ( ) ) , ChannelInfo {
753
+ network. add_channel ( 6 , ChannelInfo {
754
754
features : ChannelFeatures :: from_le_bytes ( id_to_feature_flags ! ( 6 ) ) ,
755
755
one_to_two : DirectionalChannelInfo {
756
756
src_node_id : node3. clone ( ) ,
@@ -771,7 +771,7 @@ mod tests {
771
771
} ,
772
772
announcement_message : None ,
773
773
} ) ;
774
- network. add_channel ( NetworkGraph :: get_key ( 11 , zero_hash . clone ( ) ) , ChannelInfo {
774
+ network. add_channel ( 11 , ChannelInfo {
775
775
features : ChannelFeatures :: from_le_bytes ( id_to_feature_flags ! ( 11 ) ) ,
776
776
one_to_two : DirectionalChannelInfo {
777
777
src_node_id : node5. clone ( ) ,
@@ -793,7 +793,7 @@ mod tests {
793
793
announcement_message : None ,
794
794
} ) ;
795
795
network. add_node ( node6. clone ( ) , NodeInfo {
796
- channels : vec ! ( NetworkGraph :: get_key ( 7 , zero_hash . clone ( ) ) ) ,
796
+ channels : vec ! ( 7 ) ,
797
797
lowest_inbound_channel_fees : Some ( routing_fees. clone ( ) ) ,
798
798
features : NodeFeatures :: from_le_bytes ( id_to_feature_flags ! ( 6 ) ) ,
799
799
last_update : Some ( 1 ) ,
@@ -802,7 +802,7 @@ mod tests {
802
802
addresses : Vec :: new ( ) ,
803
803
announcement_message : None ,
804
804
} ) ;
805
- network. add_channel ( NetworkGraph :: get_key ( 7 , zero_hash . clone ( ) ) , ChannelInfo {
805
+ network. add_channel ( 7 , ChannelInfo {
806
806
features : ChannelFeatures :: from_le_bytes ( id_to_feature_flags ! ( 7 ) ) ,
807
807
one_to_two : DirectionalChannelInfo {
808
808
src_node_id : node3. clone ( ) ,
@@ -849,8 +849,8 @@ mod tests {
849
849
850
850
{ // Disable channels 4 and 12 by requiring unknown feature bits
851
851
let mut network = net_graph_msg_handler. network_graph . write ( ) . unwrap ( ) ;
852
- network. get_channel_mut ( & NetworkGraph :: get_key ( 4 , zero_hash . clone ( ) ) ) . unwrap ( ) . features . set_require_unknown_bits ( ) ;
853
- network. get_channel_mut ( & NetworkGraph :: get_key ( 12 , zero_hash . clone ( ) ) ) . unwrap ( ) . features . set_require_unknown_bits ( ) ;
852
+ network. get_channel_mut ( & 4 ) . unwrap ( ) . features . set_require_unknown_bits ( ) ;
853
+ network. get_channel_mut ( & 12 ) . unwrap ( ) . features . set_require_unknown_bits ( ) ;
854
854
}
855
855
856
856
{ // If all the channels require some features we don't understand, route should fail
@@ -891,8 +891,8 @@ mod tests {
891
891
892
892
{ // Re-enable channels 4 and 12 by wiping the unknown feature bits
893
893
let mut network = net_graph_msg_handler. network_graph . write ( ) . unwrap ( ) ;
894
- network. get_channel_mut ( & NetworkGraph :: get_key ( 4 , zero_hash . clone ( ) ) ) . unwrap ( ) . features . clear_require_unknown_bits ( ) ;
895
- network. get_channel_mut ( & NetworkGraph :: get_key ( 12 , zero_hash . clone ( ) ) ) . unwrap ( ) . features . clear_require_unknown_bits ( ) ;
894
+ network. get_channel_mut ( & 4 ) . unwrap ( ) . features . clear_require_unknown_bits ( ) ;
895
+ network. get_channel_mut ( & 12 ) . unwrap ( ) . features . clear_require_unknown_bits ( ) ;
896
896
}
897
897
898
898
{ // Disable nodes 1, 2, and 8 by requiring unknown feature bits
0 commit comments