- assert_eq!(route.hops.len(), 5);
-
- assert_eq!(route.hops[0].pubkey, node2);
- assert_eq!(route.hops[0].short_channel_id, 2);
- assert_eq!(route.hops[0].fee_msat, 3000);
- assert_eq!(route.hops[0].cltv_expiry_delta, (4 << 8) | 1);
-
- assert_eq!(route.hops[1].pubkey, node3);
- assert_eq!(route.hops[1].short_channel_id, 4);
- assert_eq!(route.hops[1].fee_msat, 0);
- assert_eq!(route.hops[1].cltv_expiry_delta, (6 << 8) | 1);
-
- assert_eq!(route.hops[2].pubkey, node5);
- assert_eq!(route.hops[2].short_channel_id, 6);
- assert_eq!(route.hops[2].fee_msat, 0);
- assert_eq!(route.hops[2].cltv_expiry_delta, (11 << 8) | 1);
-
- assert_eq!(route.hops[3].pubkey, node4);
- assert_eq!(route.hops[3].short_channel_id, 11);
- assert_eq!(route.hops[3].fee_msat, 1000);
- assert_eq!(route.hops[3].cltv_expiry_delta, (8 << 8) | 1);
-
- assert_eq!(route.hops[4].pubkey, node7);
- assert_eq!(route.hops[4].short_channel_id, 8);
- assert_eq!(route.hops[4].fee_msat, 2000);
- assert_eq!(route.hops[4].cltv_expiry_delta, 42);
+ assert_eq!(route.paths[0].len(), 5);
+
+ assert_eq!(route.paths[0][0].pubkey, node2);
+ assert_eq!(route.paths[0][0].short_channel_id, 2);
+ assert_eq!(route.paths[0][0].fee_msat, 3000);
+ assert_eq!(route.paths[0][0].cltv_expiry_delta, (4 << 8) | 1);
+ assert_eq!(route.paths[0][0].node_features.le_flags(), &id_to_feature_flags!(2));
+ assert_eq!(route.paths[0][0].channel_features.le_flags(), &id_to_feature_flags!(2));
+
+ assert_eq!(route.paths[0][1].pubkey, node3);
+ assert_eq!(route.paths[0][1].short_channel_id, 4);
+ assert_eq!(route.paths[0][1].fee_msat, 0);
+ assert_eq!(route.paths[0][1].cltv_expiry_delta, (6 << 8) | 1);
+ assert_eq!(route.paths[0][1].node_features.le_flags(), &id_to_feature_flags!(3));
+ assert_eq!(route.paths[0][1].channel_features.le_flags(), &id_to_feature_flags!(4));
+
+ assert_eq!(route.paths[0][2].pubkey, node5);
+ assert_eq!(route.paths[0][2].short_channel_id, 6);
+ assert_eq!(route.paths[0][2].fee_msat, 0);
+ assert_eq!(route.paths[0][2].cltv_expiry_delta, (11 << 8) | 1);
+ assert_eq!(route.paths[0][2].node_features.le_flags(), &id_to_feature_flags!(5));
+ assert_eq!(route.paths[0][2].channel_features.le_flags(), &id_to_feature_flags!(6));
+
+ assert_eq!(route.paths[0][3].pubkey, node4);
+ assert_eq!(route.paths[0][3].short_channel_id, 11);
+ assert_eq!(route.paths[0][3].fee_msat, 1000);
+ assert_eq!(route.paths[0][3].cltv_expiry_delta, (8 << 8) | 1);
+ // If we have a peer in the node map, we'll use their features here since we don't have
+ // a way of figuring out their features from the invoice:
+ assert_eq!(route.paths[0][3].node_features.le_flags(), &id_to_feature_flags!(4));
+ assert_eq!(route.paths[0][3].channel_features.le_flags(), &id_to_feature_flags!(11));
+
+ assert_eq!(route.paths[0][4].pubkey, node7);
+ assert_eq!(route.paths[0][4].short_channel_id, 8);
+ assert_eq!(route.paths[0][4].fee_msat, 2000);
+ assert_eq!(route.paths[0][4].cltv_expiry_delta, 42);
+ assert_eq!(route.paths[0][4].node_features.le_flags(), &Vec::new()); // We dont pass flags in from invoices yet
+ assert_eq!(route.paths[0][4].channel_features.le_flags(), &Vec::new()); // We can't learn any flags from invoices, sadly