Skip to content

Commit

Permalink
Reformat files.
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmitr committed Mar 14, 2024
1 parent 23a9cbc commit d7755d0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ use lightning::ln::msgs::SocketAddress;
use lightning::ln::{PaymentHash, PaymentPreimage};

use lightning::util::persist::{
KVStore, NETWORK_GRAPH_PERSISTENCE_KEY, NETWORK_GRAPH_PERSISTENCE_PRIMARY_NAMESPACE,
NETWORK_GRAPH_PERSISTENCE_SECONDARY_NAMESPACE, SCORER_PERSISTENCE_KEY,
SCORER_PERSISTENCE_PRIMARY_NAMESPACE, SCORER_PERSISTENCE_SECONDARY_NAMESPACE,
KVStore, NETWORK_GRAPH_PERSISTENCE_KEY, NETWORK_GRAPH_PERSISTENCE_PRIMARY_NAMESPACE,
NETWORK_GRAPH_PERSISTENCE_SECONDARY_NAMESPACE, SCORER_PERSISTENCE_KEY,
SCORER_PERSISTENCE_PRIMARY_NAMESPACE, SCORER_PERSISTENCE_SECONDARY_NAMESPACE,
};

use lightning::util::config::{ChannelHandshakeConfig, UserConfig};
Expand Down
18 changes: 15 additions & 3 deletions src/payment/payment_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,13 @@ impl Readable for PaymentDetails {

if secret.is_some() {
if let Some(lsp_fee_limits) = lsp_fee_limits {
PaymentKind::Bolt11Jit { hash, preimage, secret, lsp_fee_limits, bolt11_invoice }
PaymentKind::Bolt11Jit {
hash,
preimage,
secret,
lsp_fee_limits,
bolt11_invoice,
}
} else {
PaymentKind::Bolt11 { hash, preimage, secret, bolt11_invoice }
}
Expand Down Expand Up @@ -431,7 +437,7 @@ mod tests {
)
.is_err());

let kind = PaymentKind::Bolt11 { hash, preimage: None, secret: None, bolt11_invoice: None};
let kind = PaymentKind::Bolt11 { hash, preimage: None, secret: None, bolt11_invoice: None };
let payment = PaymentDetails {
id,
kind,
Expand Down Expand Up @@ -544,7 +550,13 @@ mod tests {
);

match bolt11_jit_decoded.kind {
PaymentKind::Bolt11Jit { hash: h, preimage: p, secret: s, lsp_fee_limits: l, bolt11_invoice: i } => {
PaymentKind::Bolt11Jit {
hash: h,
preimage: p,
secret: s,
lsp_fee_limits: l,
bolt11_invoice: i,
} => {
assert_eq!(hash, h);
assert_eq!(preimage, p);
assert_eq!(secret, s);
Expand Down
7 changes: 3 additions & 4 deletions tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

use ldk_node::io::sqlite_store::SqliteStore;
use ldk_node::payment::{PaymentDirection, PaymentStatus};
use ldk_node::{
Builder, Config, Event, LogLevel, Node, NodeError, TlvEntry,
};
use ldk_node::{Builder, Config, Event, LogLevel, Node, NodeError, TlvEntry};

use lightning::ln::msgs::SocketAddress;
use lightning::util::persist::KVStore;
Expand Down Expand Up @@ -548,7 +546,8 @@ pub(crate) fn do_channel_full_cycle<E: ElectrumApi>(
let tlv1 = TlvEntry { r#type: 131073, value: vec![0x00, 0x11, 0x22, 0x33] };
let tlv2 = TlvEntry { r#type: 131075, value: vec![0xaa, 0xbb] };
let keysend_payment_id = node_a
.spontaneous_payment().send(keysend_amount_msat, node_b.node_id(), vec![tlv1, tlv2])
.spontaneous_payment()
.send(keysend_amount_msat, node_b.node_id(), vec![tlv1, tlv2])
.unwrap();
expect_event!(node_a, PaymentSuccessful);
let received_keysend_amount = match node_b.wait_next_event() {
Expand Down

0 comments on commit d7755d0

Please sign in to comment.