Skip to content

Commit 30879ed

Browse files
committed
Prepare to rustfmt newly added files
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.
1 parent 9c93bd5 commit 30879ed

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lightning/src/ln/bolt11_payment.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ mod tests {
186186
let (payment_hash, payment_secret) =
187187
nodes[1].node.create_inbound_payment(None, 7200, None).unwrap();
188188

189+
let secp_ctx = Secp256k1::new();
190+
let node_secret = nodes[1].keys_manager.backing.get_node_secret_key();
189191
let invoice = InvoiceBuilder::new(Currency::Bitcoin)
190192
.description("test".into())
191193
.payment_hash(Sha256::from_slice(&payment_hash.0).unwrap())
@@ -194,10 +196,7 @@ mod tests {
194196
.min_final_cltv_expiry_delta(144)
195197
.amount_milli_satoshis(50_000)
196198
.payment_metadata(payment_metadata.clone())
197-
.build_signed(|hash| {
198-
Secp256k1::new().sign_ecdsa_recoverable(hash,
199-
&nodes[1].keys_manager.backing.get_node_secret_key())
200-
})
199+
.build_signed(|hash| secp_ctx.sign_ecdsa_recoverable(hash, &node_secret))
201200
.unwrap();
202201

203202
let (hash, onion, params) = payment_parameters_from_invoice(&invoice).unwrap();

rustfmt_excluded_files

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
./lightning/src/ln/functional_test_utils.rs
4242
./lightning/src/ln/functional_tests.rs
4343
./lightning/src/ln/inbound_payment.rs
44+
./lightning/src/ln/invoice_utils.rs
4445
./lightning/src/ln/max_payment_path_len_tests.rs
4546
./lightning/src/ln/mod.rs
4647
./lightning/src/ln/monitor_tests.rs

0 commit comments

Comments
 (0)