Skip to content

Commit 9ae5ff8

Browse files
committed
Apply cargo +nightly fmt once
.. mostly to show the changes.
1 parent 8b0b0e2 commit 9ae5ff8

28 files changed

Lines changed: 152 additions & 114 deletions

ldk-server-client/src/client.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,8 @@
77
// You may not use this file except in accordance with one or both of these
88
// licenses.
99

10-
use prost::Message;
10+
use std::time::{SystemTime, UNIX_EPOCH};
1111

12-
use crate::error::LdkServerError;
13-
use crate::error::LdkServerErrorCode::{
14-
AuthError, InternalError, InternalServerError, InvalidRequestError, LightningError,
15-
};
1612
use bitcoin_hashes::hmac::{Hmac, HmacEngine};
1713
use bitcoin_hashes::{sha256, Hash, HashEngine};
1814
use ldk_server_protos::api::{
@@ -32,9 +28,14 @@ use ldk_server_protos::endpoints::{
3228
OPEN_CHANNEL_PATH, SPLICE_IN_PATH, SPLICE_OUT_PATH, UPDATE_CHANNEL_CONFIG_PATH,
3329
};
3430
use ldk_server_protos::error::{ErrorCode, ErrorResponse};
31+
use prost::Message;
3532
use reqwest::header::CONTENT_TYPE;
3633
use reqwest::{Certificate, Client};
37-
use std::time::{SystemTime, UNIX_EPOCH};
34+
35+
use crate::error::LdkServerError;
36+
use crate::error::LdkServerErrorCode::{
37+
AuthError, InternalError, InternalServerError, InvalidRequestError, LightningError,
38+
};
3839

3940
const APPLICATION_OCTET_STREAM: &str = "application/octet-stream";
4041

ldk-server/src/api/bolt11_receive.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
// You may not use this file except in accordance with one or both of these
88
// licenses.
99

10+
use ldk_server_protos::api::{Bolt11ReceiveRequest, Bolt11ReceiveResponse};
11+
1012
use crate::api::error::LdkServerError;
1113
use crate::service::Context;
1214
use crate::util::proto_adapter::proto_to_bolt11_description;
13-
use ldk_server_protos::api::{Bolt11ReceiveRequest, Bolt11ReceiveResponse};
1415

1516
pub(crate) fn handle_bolt11_receive_request(
1617
context: Context, request: Bolt11ReceiveRequest,

ldk-server/src/api/bolt11_send.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
// You may not use this file except in accordance with one or both of these
88
// licenses.
99

10-
use crate::api::error::LdkServerError;
11-
use crate::api::error::LdkServerErrorCode::InvalidRequestError;
12-
use crate::service::Context;
10+
use std::str::FromStr;
11+
1312
use ldk_node::lightning::routing::router::RouteParametersConfig;
1413
use ldk_node::lightning_invoice::Bolt11Invoice;
1514
use ldk_server_protos::api::{Bolt11SendRequest, Bolt11SendResponse};
16-
use std::str::FromStr;
15+
16+
use crate::api::error::LdkServerError;
17+
use crate::api::error::LdkServerErrorCode::InvalidRequestError;
18+
use crate::service::Context;
1719

1820
pub(crate) fn handle_bolt11_send_request(
1921
context: Context, request: Bolt11SendRequest,

ldk-server/src/api/bolt12_receive.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
// You may not use this file except in accordance with one or both of these
88
// licenses.
99

10+
use ldk_server_protos::api::{Bolt12ReceiveRequest, Bolt12ReceiveResponse};
11+
1012
use crate::api::error::LdkServerError;
1113
use crate::service::Context;
12-
use ldk_server_protos::api::{Bolt12ReceiveRequest, Bolt12ReceiveResponse};
1314

1415
pub(crate) fn handle_bolt12_receive_request(
1516
context: Context, request: Bolt12ReceiveRequest,

ldk-server/src/api/bolt12_send.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
// You may not use this file except in accordance with one or both of these
88
// licenses.
99

10-
use crate::api::error::LdkServerError;
11-
use crate::api::error::LdkServerErrorCode::InvalidRequestError;
12-
use crate::service::Context;
10+
use std::str::FromStr;
11+
1312
use ldk_node::lightning::offers::offer::Offer;
1413
use ldk_node::lightning::routing::router::RouteParametersConfig;
1514
use ldk_server_protos::api::{Bolt12SendRequest, Bolt12SendResponse};
16-
use std::str::FromStr;
15+
16+
use crate::api::error::LdkServerError;
17+
use crate::api::error::LdkServerErrorCode::InvalidRequestError;
18+
use crate::service::Context;
1719

1820
pub(crate) fn handle_bolt12_send_request(
1921
context: Context, request: Bolt12SendRequest,

ldk-server/src/api/close_channel.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@
77
// You may not use this file except in accordance with one or both of these
88
// licenses.
99

10-
use crate::api::error::LdkServerError;
11-
use crate::api::error::LdkServerErrorCode::InvalidRequestError;
12-
use crate::service::Context;
10+
use std::str::FromStr;
11+
1312
use ldk_node::bitcoin::secp256k1::PublicKey;
1413
use ldk_node::UserChannelId;
1514
use ldk_server_protos::api::{
1615
CloseChannelRequest, CloseChannelResponse, ForceCloseChannelRequest, ForceCloseChannelResponse,
1716
};
18-
use std::str::FromStr;
17+
18+
use crate::api::error::LdkServerError;
19+
use crate::api::error::LdkServerErrorCode::InvalidRequestError;
20+
use crate::service::Context;
1921

2022
pub(crate) fn handle_close_channel_request(
2123
context: Context, request: CloseChannelRequest,

ldk-server/src/api/error.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
// You may not use this file except in accordance with one or both of these
88
// licenses.
99

10-
use ldk_node::NodeError;
1110
use std::fmt;
1211

12+
use ldk_node::NodeError;
13+
1314
#[derive(Clone, Debug, PartialEq, Eq)]
1415
pub(crate) struct LdkServerError {
1516
// The error message containing a generic description of the error condition in English.

ldk-server/src/api/get_balances.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
// You may not use this file except in accordance with one or both of these
88
// licenses.
99

10+
use ldk_server_protos::api::{GetBalancesRequest, GetBalancesResponse};
11+
1012
use crate::api::error::LdkServerError;
1113
use crate::service::Context;
1214
use crate::util::proto_adapter::{lightning_balance_to_proto, pending_sweep_balance_to_proto};
13-
use ldk_server_protos::api::{GetBalancesRequest, GetBalancesResponse};
1415

1516
pub(crate) fn handle_get_balances_request(
1617
context: Context, _request: GetBalancesRequest,

ldk-server/src/api/get_node_info.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
// You may not use this file except in accordance with one or both of these
88
// licenses.
99

10-
use crate::api::error::LdkServerError;
11-
use crate::service::Context;
1210
use ldk_server_protos::api::{GetNodeInfoRequest, GetNodeInfoResponse};
1311
use ldk_server_protos::types::BestBlock;
1412

13+
use crate::api::error::LdkServerError;
14+
use crate::service::Context;
15+
1516
pub(crate) fn handle_get_node_info_request(
1617
context: Context, _request: GetNodeInfoRequest,
1718
) -> Result<GetNodeInfoResponse, LdkServerError> {

ldk-server/src/api/get_payment_details.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
// You may not use this file except in accordance with one or both of these
88
// licenses.
99

10+
use hex::FromHex;
11+
use ldk_node::lightning::ln::channelmanager::PaymentId;
12+
use ldk_server_protos::api::{GetPaymentDetailsRequest, GetPaymentDetailsResponse};
13+
1014
use crate::api::error::LdkServerError;
1115
use crate::api::error::LdkServerErrorCode::InvalidRequestError;
1216
use crate::service::Context;
1317
use crate::util::proto_adapter::payment_to_proto;
14-
use hex::FromHex;
15-
use ldk_node::lightning::ln::channelmanager::PaymentId;
16-
use ldk_server_protos::api::{GetPaymentDetailsRequest, GetPaymentDetailsResponse};
1718

1819
pub(crate) fn handle_get_payment_details_request(
1920
context: Context, request: GetPaymentDetailsRequest,

0 commit comments

Comments
 (0)