Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lightning-liquidity/src/lsps2/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use core::default::Default;
use core::ops::Deref;

use crate::lsps2::msgs::{
BuyRequest, BuyResponse, GetInfoRequest, GetInfoResponse, LSPS2Message, LSPS2Request,
BuyRequest, BuyResponse, LSPS2GetInfoRequest, LSPS2GetInfoResponse, LSPS2Message, LSPS2Request,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above: let's rename the world.

LSPS2Response, OpeningFeeParams,
};

Expand Down Expand Up @@ -122,7 +122,7 @@ where
peer_state_lock.pending_get_info_requests.insert(request_id.clone());
}

let request = LSPS2Request::GetInfo(GetInfoRequest { token });
let request = LSPS2Request::GetInfo(LSPS2GetInfoRequest { token });
let msg = LSPS2Message::Request(request_id.clone(), request).into();
self.pending_messages.enqueue(&counterparty_node_id, msg);

Expand Down Expand Up @@ -181,7 +181,7 @@ where
}

fn handle_get_info_response(
&self, request_id: RequestId, counterparty_node_id: &PublicKey, result: GetInfoResponse,
&self, request_id: RequestId, counterparty_node_id: &PublicKey, result: LSPS2GetInfoResponse,
) -> Result<(), LightningError> {
let outer_state_lock = self.per_peer_state.read().unwrap();
match outer_state_lock.get(counterparty_node_id) {
Expand Down
10 changes: 5 additions & 5 deletions lightning-liquidity/src/lsps2/msgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub(crate) const LSPS2_BUY_REQUEST_PAYMENT_SIZE_TOO_LARGE_ERROR_CODE: i32 = 203;

#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
/// A request made to an LSP to learn their current channel fees and parameters.
pub struct GetInfoRequest {
pub struct LSPS2GetInfoRequest {
/// An optional token to provide to the LSP.
pub token: Option<String>,
}
Expand Down Expand Up @@ -106,9 +106,9 @@ pub struct OpeningFeeParams {
pub promise: String,
}

/// A response to a [`GetInfoRequest`]
/// A response to a [`LSPS2GetInfoRequest`]
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
pub struct GetInfoResponse {
pub struct LSPS2GetInfoResponse {
/// A set of opening fee parameters.
pub opening_fee_params_menu: Vec<OpeningFeeParams>,
}
Expand Down Expand Up @@ -164,7 +164,7 @@ pub struct BuyResponse {
/// An enum that captures all the valid JSON-RPC requests in the LSPS2 protocol.
pub enum LSPS2Request {
/// A request to learn an LSP's channel fees and parameters.
GetInfo(GetInfoRequest),
GetInfo(LSPS2GetInfoRequest),
/// A request to buy a JIT channel from an LSP.
Buy(BuyRequest),
}
Expand All @@ -173,7 +173,7 @@ pub enum LSPS2Request {
/// An enum that captures all the valid JSON-RPC responses in the LSPS2 protocol.
pub enum LSPS2Response {
/// A successful response to a [`LSPS2Request::GetInfo`] request.
GetInfo(GetInfoResponse),
GetInfo(LSPS2GetInfoResponse),
/// An error response to a [`LSPS2Request::GetInfo`] request.
GetInfoError(ResponseError),
/// A successful response to a [`LSPS2Request::Buy`] request.
Expand Down
6 changes: 3 additions & 3 deletions lightning-liquidity/src/lsps2/service.rs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, these bounds are (going) to be necessary as we're cloing the ChannelManager reference for the LSPS1ServiceHandler. It's just not surfaced as it lives behind cfg(lsps1_service) for now. Assuming we don't want to macroize the bounds, I'd propose to drop this commit for now.

Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use core::ops::Deref;
use core::sync::atomic::{AtomicUsize, Ordering};

use crate::lsps2::msgs::{
BuyRequest, BuyResponse, GetInfoRequest, GetInfoResponse, LSPS2Message, LSPS2Request,
BuyRequest, BuyResponse, LSPS2GetInfoRequest, LSPS2GetInfoResponse, LSPS2Message, LSPS2Request,
LSPS2Response, OpeningFeeParams, RawOpeningFeeParams,
LSPS2_BUY_REQUEST_INVALID_OPENING_FEE_PARAMS_ERROR_CODE,
LSPS2_BUY_REQUEST_PAYMENT_SIZE_TOO_LARGE_ERROR_CODE,
Expand Down Expand Up @@ -658,7 +658,7 @@ where

match self.remove_pending_request(&mut peer_state_lock, &request_id) {
Some(LSPS2Request::GetInfo(_)) => {
let response = LSPS2Response::GetInfo(GetInfoResponse {
let response = LSPS2Response::GetInfo(LSPS2GetInfoResponse {
opening_fee_params_menu: opening_fee_params_menu
.into_iter()
.map(|param| {
Expand Down Expand Up @@ -1076,7 +1076,7 @@ where
}

fn handle_get_info_request(
&self, request_id: RequestId, counterparty_node_id: &PublicKey, params: GetInfoRequest,
&self, request_id: RequestId, counterparty_node_id: &PublicKey, params: LSPS2GetInfoRequest,
) -> Result<(), LightningError> {
let (result, response) = {
let mut outer_state_lock = self.per_peer_state.write().unwrap();
Expand Down
Loading