// construct one themselves.
use crate::ln::{inbound_payment, ChannelId, PaymentHash, PaymentPreimage, PaymentSecret};
use crate::ln::channel::{Channel, ChannelPhase, ChannelContext, ChannelError, ChannelUpdateStatus, ShutdownResult, UnfundedChannelContext, UpdateFulfillCommitFetch, OutboundV1Channel, InboundV1Channel};
-use crate::ln::features::{ChannelFeatures, ChannelTypeFeatures, InitFeatures, NodeFeatures};
+use crate::ln::features::{Bolt12InvoiceFeatures, ChannelFeatures, ChannelTypeFeatures, InitFeatures, NodeFeatures};
#[cfg(any(feature = "_test_utils", test))]
use crate::ln::features::Bolt11InvoiceFeatures;
use crate::routing::gossip::NetworkGraph;
provided_bolt11_invoice_features(&self.default_configuration)
}
+ /// Fetches the set of [`Bolt12InvoiceFeatures`] flags that are provided by or required by
+ /// [`ChannelManager`].
+ fn bolt12_invoice_features(&self) -> Bolt12InvoiceFeatures {
+ provided_bolt12_invoice_features(&self.default_configuration)
+ }
+
/// Fetches the set of [`ChannelFeatures`] flags which are provided by or required by
/// [`ChannelManager`].
pub fn channel_features(&self) -> ChannelFeatures {
provided_init_features(config).to_context()
}
+/// Fetches the set of [`Bolt12InvoiceFeatures`] flags that are provided by or required by
+/// [`ChannelManager`].
+pub(crate) fn provided_bolt12_invoice_features(config: &UserConfig) -> Bolt12InvoiceFeatures {
+ provided_init_features(config).to_context()
+}
+
/// Fetches the set of [`ChannelFeatures`] flags which are provided by or required by
/// [`ChannelManager`].
pub(crate) fn provided_channel_features(config: &UserConfig) -> ChannelFeatures {
use crate::chain::transaction::OutPoint;
use crate::sign::EntropySource;
use crate::ln::ChannelId;
- use crate::ln::features::{BlindedHopFeatures, Bolt12InvoiceFeatures, ChannelFeatures, InitFeatures, NodeFeatures};
+ use crate::ln::features::{BlindedHopFeatures, ChannelFeatures, InitFeatures, NodeFeatures};
use crate::ln::msgs::{ErrorAction, LightningError, UnsignedChannelUpdate, MAX_VALUE_MSAT};
use crate::ln::channelmanager;
use crate::offers::invoice::BlindedPayInfo;
do_simple_mpp_route_test(clear_payment_params);
// MPP to a 1-hop blinded path for nodes[2]
- let bolt12_features: Bolt12InvoiceFeatures = channelmanager::provided_bolt11_invoice_features(&config).to_context();
+ let bolt12_features = channelmanager::provided_bolt12_invoice_features(&config);
let blinded_path = BlindedPath {
introduction_node_id: nodes[2],
blinding_point: ln_test_utils::pubkey(42),
cltv_expiry_delta: 10,
features: BlindedHopFeatures::empty(),
};
- let bolt12_features: Bolt12InvoiceFeatures = channelmanager::provided_bolt11_invoice_features(&config).to_context();
+ let bolt12_features = channelmanager::provided_bolt12_invoice_features(&config);
let payment_params = PaymentParameters::blinded(vec![
(blinded_payinfo.clone(), blinded_path.clone()),
(blinded_payinfo.clone(), blinded_path.clone())])
let random_seed_bytes = keys_manager.get_secure_random_bytes();
let config = UserConfig::default();
- let bolt12_features: Bolt12InvoiceFeatures = channelmanager::provided_bolt11_invoice_features(&config).to_context();
+ let bolt12_features = channelmanager::provided_bolt12_invoice_features(&config);
let blinded_path_1 = BlindedPath {
introduction_node_id: nodes[2],
blinding_point: ln_test_utils::pubkey(42),
(blinded_payinfo_2.clone(), blinded_path_2.clone()),
];
let payment_params = PaymentParameters::blinded(blinded_hints.clone())
- .with_bolt12_features(bolt12_features.clone()).unwrap();
+ .with_bolt12_features(bolt12_features).unwrap();
let mut route_params = RouteParameters::from_payment_params_and_value(payment_params, 100_000);
route_params.max_total_routing_fee_msat = Some(100_000);
blinded_hints[1].0.htlc_maximum_msat = 2_8089_0861_1584_0000;
blinded_hints[1].0.cltv_expiry_delta = 0;
- let bolt12_features: Bolt12InvoiceFeatures = channelmanager::provided_bolt11_invoice_features(&config).to_context();
+ let bolt12_features = channelmanager::provided_bolt12_invoice_features(&config);
let payment_params = PaymentParameters::blinded(blinded_hints.clone())
- .with_bolt12_features(bolt12_features.clone()).unwrap();
+ .with_bolt12_features(bolt12_features).unwrap();
let netgraph = network_graph.read_only();
let route_params = RouteParameters::from_payment_params_and_value(
];
blinded_hints[1].1.introduction_node_id = nodes[6];
- let bolt12_features: Bolt12InvoiceFeatures = channelmanager::provided_bolt11_invoice_features(&config).to_context();
+ let bolt12_features = channelmanager::provided_bolt12_invoice_features(&config);
let payment_params = PaymentParameters::blinded(blinded_hints.clone())
.with_bolt12_features(bolt12_features.clone()).unwrap();
blinded_hints[2].1.introduction_node_id = nodes[6];
- let bolt12_features: Bolt12InvoiceFeatures = channelmanager::provided_bolt11_invoice_features(&config).to_context();
+ let bolt12_features = channelmanager::provided_bolt12_invoice_features(&config);
let payment_params = PaymentParameters::blinded(blinded_hints.clone())
.with_bolt12_features(bolt12_features.clone()).unwrap();
cltv_expiry_delta: 0,
features: BlindedHopFeatures::empty(),
};
- let bolt12_features: Bolt12InvoiceFeatures = channelmanager::provided_bolt11_invoice_features(&config).to_context();
+ let bolt12_features = channelmanager::provided_bolt12_invoice_features(&config);
PaymentParameters::blinded(vec![(blinded_payinfo, blinded_path)])
.with_bolt12_features(bolt12_features.clone()).unwrap()
} else {
features: BlindedHopFeatures::empty(),
}, blinded_path.clone()));
}
- let bolt12_features: Bolt12InvoiceFeatures = channelmanager::provided_bolt11_invoice_features(&config).to_context();
+ let bolt12_features = channelmanager::provided_bolt12_invoice_features(&config);
PaymentParameters::blinded(blinded_hints.clone())
.with_bolt12_features(bolt12_features.clone()).unwrap()
} else {
],
})
];
- let bolt12_features: Bolt12InvoiceFeatures = channelmanager::provided_bolt11_invoice_features(&config).to_context();
+ let bolt12_features = channelmanager::provided_bolt12_invoice_features(&config);
let payment_params = PaymentParameters::blinded(blinded_hints.clone())
.with_bolt12_features(bolt12_features.clone()).unwrap();
let route_params = RouteParameters::from_payment_params_and_value(
features: BlindedHopFeatures::empty(),
}, blinded_path.clone()));
}
- let bolt12_features: Bolt12InvoiceFeatures = channelmanager::provided_bolt11_invoice_features(&config).to_context();
+ let bolt12_features = channelmanager::provided_bolt12_invoice_features(&config);
PaymentParameters::blinded(blinded_hints.clone())
.with_bolt12_features(bolt12_features.clone()).unwrap()
};