Skip to content

Commit

Permalink
Prepare to rustfmt newly added files
Browse files Browse the repository at this point in the history
In the next commit we'll `rustfmt` newly-added files, but before
we do so we clean up some code so that the resulting files won't be
quite as absurd. We also exclude the new `invoice_utils.rs` file,
as it needs quite substantial cleanups.
  • Loading branch information
TheBlueMatt committed Aug 12, 2024
1 parent 0657f9b commit 008de74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lightning/src/ln/bolt11_payment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ mod tests {
let (payment_hash, payment_secret) =
nodes[1].node.create_inbound_payment(None, 7200, None).unwrap();

let secp_ctx = Secp256k1::new();
let node_secret = nodes[1].keys_manager.backing.get_node_secret_key();
let invoice = InvoiceBuilder::new(Currency::Bitcoin)
.description("test".into())
.payment_hash(Sha256::from_slice(&payment_hash.0).unwrap())
Expand All @@ -194,10 +196,7 @@ mod tests {
.min_final_cltv_expiry_delta(144)
.amount_milli_satoshis(50_000)
.payment_metadata(payment_metadata.clone())
.build_signed(|hash| {
Secp256k1::new().sign_ecdsa_recoverable(hash,
&nodes[1].keys_manager.backing.get_node_secret_key())
})
.build_signed(|hash| secp_ctx.sign_ecdsa_recoverable(hash, &node_secret))
.unwrap();

let (hash, onion, params) = payment_parameters_from_invoice(&invoice).unwrap();
Expand Down
1 change: 1 addition & 0 deletions rustfmt_excluded_files
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
./lightning/src/ln/functional_test_utils.rs
./lightning/src/ln/functional_tests.rs
./lightning/src/ln/inbound_payment.rs
./lightning/src/ln/invoice_utils.rs
./lightning/src/ln/max_payment_path_len_tests.rs
./lightning/src/ln/mod.rs
./lightning/src/ln/monitor_tests.rs
Expand Down

0 comments on commit 008de74

Please sign in to comment.