Skip to content

Commit 20820af

Browse files
authored
Merge pull request #1051 from lightningdevkit/create-pull-request/patch
Automated nightly rustfmt (2026-08-16)
2 parents 13799a4 + 038455c commit 20820af

2 files changed

Lines changed: 17 additions & 12 deletions

File tree

src/payment/store.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,9 +1074,10 @@ mod tests {
10741074

10751075
#[test]
10761076
fn funding_reclassification_does_not_downgrade_an_advanced_record() {
1077-
use bitcoin::hashes::Hash;
10781077
use std::str::FromStr;
10791078

1079+
use bitcoin::hashes::Hash;
1080+
10801081
// A splice funding payment wallet sync has already advanced to Succeeded/Confirmed.
10811082
let txid = Txid::from_byte_array([7u8; 32]);
10821083
let id = PaymentId(txid.to_byte_array());
@@ -1162,9 +1163,10 @@ mod tests {
11621163

11631164
#[test]
11641165
fn funding_reclassification_keeps_confirmed_candidate_figures() {
1165-
use bitcoin::hashes::Hash;
11661166
use std::str::FromStr;
11671167

1168+
use bitcoin::hashes::Hash;
1169+
11681170
// A funding payment whose first candidate wallet sync has already seen confirm — e.g. the
11691171
// counterparty's broadcast of it was picked up before our own later candidate was
11701172
// classified. The record is unclassified (created by the sync fallthrough).
@@ -1247,9 +1249,10 @@ mod tests {
12471249

12481250
#[test]
12491251
fn funding_reclassification_merges_figures_for_the_confirmed_candidate() {
1250-
use bitcoin::hashes::Hash;
12511252
use std::str::FromStr;
12521253

1254+
use bitcoin::hashes::Hash;
1255+
12531256
// Wallet sync confirmed the transaction before classification ran, so the record carries
12541257
// the wallet's own view of amount/fee, which cannot represent our contribution to a shared
12551258
// funding output.
@@ -1315,11 +1318,12 @@ mod tests {
13151318

13161319
#[tokio::test]
13171320
async fn funding_classification_merge_preserves_advanced_record() {
1318-
use bitcoin::hashes::Hash;
1319-
use lightning::util::test_utils::TestLogger;
13201321
use std::str::FromStr;
13211322
use std::sync::Arc;
13221323

1324+
use bitcoin::hashes::Hash;
1325+
use lightning::util::test_utils::TestLogger;
1326+
13231327
use crate::data_store::DataStore;
13241328
use crate::io::test_utils::InMemoryStore;
13251329
use crate::types::{DynStore, DynStoreWrapper};

tests/upgrade_downgrade_tests.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,6 @@ mod common;
2020
use std::str::FromStr;
2121
use std::time::Duration;
2222

23-
use crate::common::{
24-
expect_channel_pending_event, expect_channel_ready_event, expect_event,
25-
expect_payment_claimable_event, expect_payment_received_event, expect_payment_successful_event,
26-
generate_blocks_and_wait, generate_listening_addresses, premine_and_distribute_funds,
27-
random_config, random_storage_path, setup_bitcoind_and_electrsd, setup_node, wait_for_tx,
28-
TestChainSource,
29-
};
3023
use bitcoin::hashes::sha256::Hash as Sha256;
3124
use bitcoin::hashes::Hash;
3225
use bitcoin::secp256k1::PublicKey;
@@ -41,6 +34,14 @@ use ldk_node::{Builder, Event, Node};
4134
use ldk_node_070::lightning_types::payment::PaymentHash as OldPaymentHash;
4235
use lightning_types::payment::{PaymentHash, PaymentPreimage};
4336

37+
use crate::common::{
38+
expect_channel_pending_event, expect_channel_ready_event, expect_event,
39+
expect_payment_claimable_event, expect_payment_received_event, expect_payment_successful_event,
40+
generate_blocks_and_wait, generate_listening_addresses, premine_and_distribute_funds,
41+
random_config, random_storage_path, setup_bitcoind_and_electrsd, setup_node, wait_for_tx,
42+
TestChainSource,
43+
};
44+
4445
const RECEIVER_SEED_BYTES: [u8; 64] = [43; 64];
4546
const CHANNEL_AMOUNT_SAT: u64 = 500_000;
4647
const CLAIM_AMOUNT_MSAT: u64 = 100_000;

0 commit comments

Comments
 (0)