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

Commit 812ad1d

Browse files
committed
Rename OrderPayment to PaymentInfo
.. not super descriptive, but more in line with `ChannelInfo`
1 parent 297df31 commit 812ad1d

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/lsps1/event.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
//! Contains LSPS1 event types
1111
12-
use super::msgs::{ChannelInfo, OptionsSupported, OrderId, OrderParams, OrderPayment};
12+
use super::msgs::{ChannelInfo, OptionsSupported, OrderId, OrderParams, PaymentInfo};
1313

1414
use crate::lsps0::ser::RequestId;
1515
use crate::prelude::String;
@@ -60,7 +60,7 @@ pub enum LSPS1ClientEvent {
6060
/// The order created by client and approved by LSP.
6161
order: OrderParams,
6262
/// The details regarding payment of the order
63-
payment: OrderPayment,
63+
payment: PaymentInfo,
6464
/// The details regarding state of the channel ordered.
6565
channel: Option<ChannelInfo>,
6666
},

src/lsps1/msgs.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ pub struct CreateOrderResponse {
132132
/// The current state of the order.
133133
pub order_state: OrderState,
134134
/// Contains details about how to pay for the order.
135-
pub payment: OrderPayment,
135+
pub payment: PaymentInfo,
136136
/// Contains information about the channel state.
137137
pub channel: Option<ChannelInfo>,
138138
}
@@ -151,7 +151,7 @@ pub enum OrderState {
151151

152152
/// Details regarding how to pay for an order.
153153
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
154-
pub struct OrderPayment {
154+
pub struct PaymentInfo {
155155
/// Indicates the current state of the payment.
156156
pub state: PaymentState,
157157
/// The total fee the LSP will charge to open this channel in satoshi.
@@ -175,7 +175,7 @@ pub struct OrderPayment {
175175
pub onchain_payment: Option<OnchainPayment>,
176176
}
177177

178-
/// The state of an [`OrderPayment`].
178+
/// The state of an [`PaymentInfo`].
179179
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
180180
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
181181
pub enum PaymentState {
@@ -399,7 +399,7 @@ mod tests {
399399
"confirmed": false
400400
}
401401
}"#;
402-
let _payment: OrderPayment = serde_json::from_str(json_str).unwrap();
402+
let _payment: PaymentInfo = serde_json::from_str(json_str).unwrap();
403403

404404
let json_str = r#"{
405405
"funded_at": "2012-04-23T18:25:43.511Z",

src/lsps1/service.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
use super::event::LSPS1ServiceEvent;
1313
use super::msgs::{
1414
ChannelInfo, CreateOrderRequest, CreateOrderResponse, GetInfoResponse, GetOrderRequest,
15-
LSPS1Message, LSPS1Request, LSPS1Response, OptionsSupported, OrderId, OrderParams,
16-
OrderPayment, OrderState, LSPS1_CREATE_ORDER_REQUEST_ORDER_MISMATCH_ERROR_CODE,
15+
LSPS1Message, LSPS1Request, LSPS1Response, OptionsSupported, OrderId, OrderParams, OrderState,
16+
PaymentInfo, LSPS1_CREATE_ORDER_REQUEST_ORDER_MISMATCH_ERROR_CODE,
1717
};
1818
use super::utils::is_valid;
1919
use crate::message_queue::MessageQueue;
@@ -75,7 +75,7 @@ struct OutboundLSPS1Config {
7575
order: OrderParams,
7676
created_at: chrono::DateTime<Utc>,
7777
expires_at: chrono::DateTime<Utc>,
78-
payment: OrderPayment,
78+
payment: PaymentInfo,
7979
}
8080

8181
struct OutboundCRChannel {
@@ -86,7 +86,7 @@ struct OutboundCRChannel {
8686
impl OutboundCRChannel {
8787
fn new(
8888
order: OrderParams, created_at: chrono::DateTime<Utc>, expires_at: chrono::DateTime<Utc>,
89-
order_id: OrderId, payment: OrderPayment,
89+
order_id: OrderId, payment: PaymentInfo,
9090
) -> Self {
9191
Self {
9292
state: OutboundRequestState::OrderCreated { order_id },
@@ -238,7 +238,7 @@ where
238238
///
239239
/// [`LSPS1ServiceEvent::RequestForPaymentDetails`]: crate::lsps1::event::LSPS1ServiceEvent::RequestForPaymentDetails
240240
pub fn send_payment_details(
241-
&self, request_id: RequestId, counterparty_node_id: &PublicKey, payment: OrderPayment,
241+
&self, request_id: RequestId, counterparty_node_id: &PublicKey, payment: PaymentInfo,
242242
created_at: chrono::DateTime<Utc>, expires_at: chrono::DateTime<Utc>,
243243
) -> Result<(), APIError> {
244244
let (result, response) = {

0 commit comments

Comments
 (0)