Skip to content

Commit dee91ff

Browse files
committed
f test
1 parent c787198 commit dee91ff

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
@@ -3351,7 +3351,8 @@ mod tests {
33513351

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

@@ -4701,21 +4702,32 @@ mod tests {
47014702

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

47214733
#[test]

0 commit comments

Comments
 (0)