use bitcoin::network::constants::Network;
use core::time::Duration;
-use crate::blinded_path::BlindedPath;
+use crate::blinded_path::{BlindedPath, IntroductionNode};
use crate::events::{Event, MessageSendEventsProvider, PaymentPurpose};
use crate::ln::channelmanager::{PaymentId, RecentPaymentDetails, Retry, self};
use crate::ln::functional_test_utils::*;
assert_ne!(offer.signing_pubkey(), bob_id);
assert!(!offer.paths().is_empty());
for path in offer.paths() {
- assert_ne!(path.introduction_node_id, bob_id);
- assert_ne!(path.introduction_node_id, charlie_id);
+ assert_ne!(path.introduction_node, IntroductionNode::NodeId(bob_id));
+ assert_ne!(path.introduction_node, IntroductionNode::NodeId(charlie_id));
}
// Use a one-hop blinded path when Bob is announced and all his peers are Tor-only.
assert_ne!(offer.signing_pubkey(), bob_id);
assert!(!offer.paths().is_empty());
for path in offer.paths() {
- assert_eq!(path.introduction_node_id, bob_id);
+ assert_eq!(path.introduction_node, IntroductionNode::NodeId(bob_id));
}
}
assert_ne!(offer.signing_pubkey(), bob_id);
assert!(!offer.paths().is_empty());
for path in offer.paths() {
- assert_eq!(path.introduction_node_id, nodes[4].node.get_our_node_id());
+ assert_eq!(path.introduction_node, IntroductionNode::NodeId(nodes[4].node.get_our_node_id()));
}
}
assert_ne!(offer.signing_pubkey(), alice_id);
assert!(!offer.paths().is_empty());
for path in offer.paths() {
- assert_eq!(path.introduction_node_id, bob_id);
+ assert_eq!(path.introduction_node, IntroductionNode::NodeId(bob_id));
}
let payment_id = PaymentId([1; 32]);
let (invoice_request, reply_path) = extract_invoice_request(alice, &onion_message);
assert_eq!(invoice_request.amount_msats(), None);
assert_ne!(invoice_request.payer_id(), david_id);
- assert_eq!(reply_path.unwrap().introduction_node_id, charlie_id);
+ assert_eq!(reply_path.unwrap().introduction_node, IntroductionNode::NodeId(charlie_id));
let onion_message = alice.onion_messenger.next_onion_message_for_peer(charlie_id).unwrap();
charlie.onion_messenger.handle_onion_message(&alice_id, &onion_message);
assert_ne!(invoice.signing_pubkey(), alice_id);
assert!(!invoice.payment_paths().is_empty());
for (_, path) in invoice.payment_paths() {
- assert_eq!(path.introduction_node_id, bob_id);
+ assert_eq!(path.introduction_node, IntroductionNode::NodeId(bob_id));
}
route_bolt12_payment(david, &[charlie, bob, alice], &invoice);
assert_ne!(refund.payer_id(), david_id);
assert!(!refund.paths().is_empty());
for path in refund.paths() {
- assert_eq!(path.introduction_node_id, charlie_id);
+ assert_eq!(path.introduction_node, IntroductionNode::NodeId(charlie_id));
}
expect_recent_payment!(david, RecentPaymentDetails::AwaitingInvoice, payment_id);
assert_ne!(invoice.signing_pubkey(), alice_id);
assert!(!invoice.payment_paths().is_empty());
for (_, path) in invoice.payment_paths() {
- assert_eq!(path.introduction_node_id, bob_id);
+ assert_eq!(path.introduction_node, IntroductionNode::NodeId(bob_id));
}
route_bolt12_payment(david, &[charlie, bob, alice], &invoice);
assert_ne!(offer.signing_pubkey(), alice_id);
assert!(!offer.paths().is_empty());
for path in offer.paths() {
- assert_eq!(path.introduction_node_id, alice_id);
+ assert_eq!(path.introduction_node, IntroductionNode::NodeId(alice_id));
}
let payment_id = PaymentId([1; 32]);
let (invoice_request, reply_path) = extract_invoice_request(alice, &onion_message);
assert_eq!(invoice_request.amount_msats(), None);
assert_ne!(invoice_request.payer_id(), bob_id);
- assert_eq!(reply_path.unwrap().introduction_node_id, bob_id);
+ assert_eq!(reply_path.unwrap().introduction_node, IntroductionNode::NodeId(bob_id));
let onion_message = alice.onion_messenger.next_onion_message_for_peer(bob_id).unwrap();
bob.onion_messenger.handle_onion_message(&alice_id, &onion_message);
assert_ne!(invoice.signing_pubkey(), alice_id);
assert!(!invoice.payment_paths().is_empty());
for (_, path) in invoice.payment_paths() {
- assert_eq!(path.introduction_node_id, alice_id);
+ assert_eq!(path.introduction_node, IntroductionNode::NodeId(alice_id));
}
route_bolt12_payment(bob, &[alice], &invoice);
assert_ne!(refund.payer_id(), bob_id);
assert!(!refund.paths().is_empty());
for path in refund.paths() {
- assert_eq!(path.introduction_node_id, bob_id);
+ assert_eq!(path.introduction_node, IntroductionNode::NodeId(bob_id));
}
expect_recent_payment!(bob, RecentPaymentDetails::AwaitingInvoice, payment_id);
assert_ne!(invoice.signing_pubkey(), alice_id);
assert!(!invoice.payment_paths().is_empty());
for (_, path) in invoice.payment_paths() {
- assert_eq!(path.introduction_node_id, alice_id);
+ assert_eq!(path.introduction_node, IntroductionNode::NodeId(alice_id));
}
route_bolt12_payment(bob, &[alice], &invoice);