Skip to content

Commit 4f8eadb

Browse files
committed
f test
1 parent 7944f14 commit 4f8eadb

File tree

1 file changed

+23
-11
lines changed

1 file changed

+23
-11
lines changed

lightning/src/ln/msgs.rs

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3352,7 +3352,8 @@ mod tests {
33523352

33533353
#[cfg(feature = "std")]
33543354
use std::net::{Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6, ToSocketAddrs};
3355-
use crate::blinded_path::{BlindedPath, Direction, IntroductionNode};
3355+
use types::features::{BlindedHopFeatures, Bolt12InvoiceFeatures};
3356+
use crate::blinded_path::payment::{BlindedPayInfo, BlindedPaymentPath};
33563357
#[cfg(feature = "std")]
33573358
use crate::ln::msgs::SocketAddressParseError;
33583359

@@ -4702,21 +4703,32 @@ mod tests {
47024703

47034704
#[test]
47044705
fn encoding_outbound_trampoline_payload() {
4705-
let public_key = PublicKey::from_slice(&<Vec<u8>>::from_hex("02eec7245d6b7d2ccb30380bfbe2a3648cd7a942653f5aa340edcea1f283686619").unwrap()).unwrap();
4706+
let mut trampoline_features = Bolt12InvoiceFeatures::empty();
4707+
trampoline_features.set_basic_mpp_optional();
4708+
let introduction_node = PublicKey::from_slice(&<Vec<u8>>::from_hex("032c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991").unwrap()).unwrap();
4709+
let blinding_point = PublicKey::from_slice(&<Vec<u8>>::from_hex("02eec7245d6b7d2ccb30380bfbe2a3648cd7a942653f5aa340edcea1f283686619").unwrap()).unwrap();
47064710
let trampoline_payload = OutboundTrampolinePayload::BlindedForward {
4707-
amt_to_forward: 100000000,
4708-
outgoing_cltv_value: 800000,
4711+
amt_to_forward: 150_000_000,
4712+
outgoing_cltv_value: 800_000,
47094713
payment_paths: vec![
4710-
BlindedPath {
4711-
introduction_node: IntroductionNode::DirectedShortChannelId(Direction::NodeOne, 12),
4712-
blinding_point: public_key,
4713-
blinded_hops: vec![],
4714-
}
4714+
BlindedPaymentPath::from_raw(
4715+
introduction_node,
4716+
blinding_point,
4717+
vec![],
4718+
BlindedPayInfo{
4719+
fee_base_msat: 500,
4720+
fee_proportional_millionths: 1_000,
4721+
cltv_expiry_delta: 36,
4722+
htlc_minimum_msat: 1,
4723+
htlc_maximum_msat: 500_000_000,
4724+
features: BlindedHopFeatures::empty(),
4725+
}
4726+
)
47154727
],
4716-
invoice_features: None,
4728+
invoice_features: Some(trampoline_features),
47174729
};
47184730
let serialized_payload = trampoline_payload.encode().to_lower_hex_string();
4719-
assert_eq!(serialized_payload, "3c020405f5e10004030c3500fe000102362b00000000000000000c02eec7245d6b7d2ccb30380bfbe2a3648cd7a942653f5aa340edcea1f28368661900");
4731+
assert_eq!(serialized_payload, "71020408f0d18004030c35001503020000165f032c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e66868099102eec7245d6b7d2ccb30380bfbe2a3648cd7a942653f5aa340edcea1f28368661900000001f4000003e800240000000000000001000000001dcd65000000");
47204732
}
47214733

47224734
#[test]

0 commit comments

Comments
 (0)