Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit 0f76819

Browse files
committed
Revert "Re-introduce feature gate for lsps1_service"
This reverts commit 244b1da.
1 parent ffc828e commit 0f76819

File tree

5 files changed

+3
-22
lines changed

5 files changed

+3
-22
lines changed

Cargo.toml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,3 @@ lightning-background-processor = { version = "0.0.123", default-features = false
4343
# lightning-background-processor = { path = "../rust-lightning/lightning-background-processor", default-features = false, features = ["std"] }
4444
proptest = "1.0.0"
4545
tokio = { version = "1.35", default-features = false, features = [ "rt-multi-thread", "time", "sync", "macros" ] }
46-
47-
[lints.rust.unexpected_cfgs]
48-
level = "forbid"
49-
# When adding a new cfg attribute, ensure that it is added to this list.
50-
check-cfg = [
51-
"cfg(lsps1_service)",
52-
]

src/lsps1/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@
1212
pub mod client;
1313
pub mod event;
1414
pub mod msgs;
15-
#[cfg(lsps1_service)]
1615
pub mod service;
1716
pub(crate) mod utils;

src/lsps1/msgs.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ pub(crate) const LSPS1_GET_INFO_METHOD_NAME: &str = "lsps1.get_info";
1919
pub(crate) const LSPS1_CREATE_ORDER_METHOD_NAME: &str = "lsps1.create_order";
2020
pub(crate) const LSPS1_GET_ORDER_METHOD_NAME: &str = "lsps1.get_order";
2121

22-
pub(crate) const _LSPS1_CREATE_ORDER_REQUEST_INVALID_PARAMS_ERROR_CODE: i32 = -32602;
23-
#[cfg(lsps1_service)]
22+
pub(crate) const LSPS1_CREATE_ORDER_REQUEST_INVALID_PARAMS_ERROR_CODE: i32 = -32602;
2423
pub(crate) const LSPS1_CREATE_ORDER_REQUEST_ORDER_MISMATCH_ERROR_CODE: i32 = 100;
2524

2625
/// The identifier of an order.

src/manager.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ use crate::message_queue::MessageQueue;
1111

1212
use crate::lsps1::client::{LSPS1ClientConfig, LSPS1ClientHandler};
1313
use crate::lsps1::msgs::LSPS1Message;
14-
#[cfg(lsps1_service)]
1514
use crate::lsps1::service::{LSPS1ServiceConfig, LSPS1ServiceHandler};
1615

1716
use crate::lsps2::client::{LSPS2ClientConfig, LSPS2ClientHandler};
@@ -42,7 +41,6 @@ const LSPS_FEATURE_BIT: usize = 729;
4241
/// to provide liquidity services to clients.
4342
pub struct LiquidityServiceConfig {
4443
/// Optional server-side configuration for LSPS1 channel requests.
45-
#[cfg(lsps1_service)]
4644
pub lsps1_service_config: Option<LSPS1ServiceConfig>,
4745
/// Optional server-side configuration for JIT channels
4846
/// should you want to support them.
@@ -94,7 +92,6 @@ where
9492
ignored_peers: RwLock<HashSet<PublicKey>>,
9593
lsps0_client_handler: LSPS0ClientHandler<ES>,
9694
lsps0_service_handler: Option<LSPS0ServiceHandler>,
97-
#[cfg(lsps1_service)]
9895
lsps1_service_handler: Option<LSPS1ServiceHandler<ES, CM, C>>,
9996
lsps1_client_handler: Option<LSPS1ClientHandler<ES>>,
10097
lsps2_service_handler: Option<LSPS2ServiceHandler<CM>>,
@@ -164,7 +161,6 @@ where {
164161
})
165162
});
166163

167-
#[cfg(lsps1_service)]
168164
let lsps1_service_handler = service_config.as_ref().and_then(|config| {
169165
if let Some(number) =
170166
<LSPS1ServiceHandler<ES> as ProtocolMessageHandler>::PROTOCOL_NUMBER
@@ -203,7 +199,6 @@ where {
203199
lsps0_client_handler,
204200
lsps0_service_handler,
205201
lsps1_client_handler,
206-
#[cfg(lsps1_service)]
207202
lsps1_service_handler,
208203
lsps2_client_handler,
209204
lsps2_service_handler,
@@ -230,7 +225,6 @@ where {
230225
}
231226

232227
/// Returns a reference to the LSPS1 server-side handler.
233-
#[cfg(lsps1_service)]
234228
pub fn lsps1_service_handler(&self) -> Option<&LSPS1ServiceHandler<ES, CM, C>> {
235229
self.lsps1_service_handler.as_ref()
236230
}
@@ -424,18 +418,15 @@ where {
424418
},
425419
}
426420
},
427-
LSPSMessage::LSPS1(_msg @ LSPS1Message::Request(..)) => {
428-
#[cfg(lsps1_service)]
421+
LSPSMessage::LSPS1(msg @ LSPS1Message::Request(..)) => {
429422
match &self.lsps1_service_handler {
430423
Some(lsps1_service_handler) => {
431-
lsps1_service_handler.handle_message(_msg, sender_node_id)?;
424+
lsps1_service_handler.handle_message(msg, sender_node_id)?;
432425
},
433426
None => {
434427
return Err(LightningError { err: format!("Received LSPS1 request message without LSPS1 service handler configured. From node = {:?}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Info)});
435428
},
436429
}
437-
#[cfg(not(lsps1_service))]
438-
return Err(LightningError { err: format!("Received LSPS1 request message without LSPS1 service handler configured. From node = {:?}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Info)});
439430
},
440431
LSPSMessage::LSPS2(msg @ LSPS2Message::Response(..)) => {
441432
match &self.lsps2_client_handler {

tests/lsps2_integration_tests.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ fn invoice_generation_flow() {
8585
let promise_secret = [42; 32];
8686
let lsps2_service_config = LSPS2ServiceConfig { promise_secret };
8787
let service_config = LiquidityServiceConfig {
88-
#[cfg(lsps1_service)]
8988
lsps1_service_config: None,
9089
lsps2_service_config: Some(lsps2_service_config),
9190
advertise_service: true,

0 commit comments

Comments
 (0)