Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/cron-weekly-rustfmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Nightly rustfmt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you test-run this job in CI? (temp. schedule to trigger it?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you test-run this job in CI? (temp. schedule to trigger it?)

No, but it's a carbon copy of https://github.com/rust-bitcoin/rust-bitcoin/blob/master/.github/workflows/cron-weekly-rustfmt.yml, which is run weekly over at rust-bitcoin. See for example rust-bitcoin/rust-bitcoin#5120

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we'll find out if the weekly works or not...

on:
schedule:
- cron: "0 0 * * 0" # runs weekly on Sunday at 00:00
workflow_dispatch: # allows manual triggering
jobs:
format:
name: Nightly rustfmt
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Run Nightly rustfmt
# Run the formatter and manually remove trailing whitespace.
run: cargo +nightly fmt && git ls-files -- '*.rs' -z | xargs sed -E -i'' -e 's/[[:space:]]+$//'
- name: Get the current date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
author: Fmt Bot <bot@example.com>
title: Automated nightly rustfmt (${{ env.date }})
body: |
Automated nightly `rustfmt` changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action
commit-message: ${{ env.date }} automated rustfmt nightly
labels: rustfmt
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ authors = ["Elias Rohrer <dev@tnull.de>"]
homepage = "https://lightningdevkit.org/"
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.85"
description = "A ready-to-go node implementation built using LDK."
repository = "https://github.com/lightningdevkit/ldk-node/"
readme = "README.md"
Expand Down
4 changes: 0 additions & 4 deletions rust-toolchain.toml

This file was deleted.

2 changes: 1 addition & 1 deletion rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use_field_init_shorthand = true
max_width = 100
match_block_trailing_comma = true
format_code_in_doc_comments = true
overflow_delimited_expr = true
comment_width = 100
format_macro_matchers = true
group_imports = "StdExternalCrate"
Expand All @@ -17,3 +16,4 @@ style_edition = "2021"
# TBD: do we want comment and string wrapping?
#wrap_comments = true
#format_strings = true
#overflow_delimited_expr = true
7 changes: 4 additions & 3 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -628,9 +628,10 @@ impl NodeBuilder {
derive_xprv(config, &seed_bytes, VSS_HARDENED_CHILD_INDEX, Arc::clone(&logger))?;

let lnurl_auth_xprv = vss_xprv
.derive_priv(&Secp256k1::new(), &[ChildNumber::Hardened {
index: VSS_LNURL_AUTH_HARDENED_CHILD_INDEX,
}])
.derive_priv(
&Secp256k1::new(),
&[ChildNumber::Hardened { index: VSS_LNURL_AUTH_HARDENED_CHILD_INDEX }],
)
.map_err(|e| {
log_error!(logger, "Failed to derive VSS secret: {}", e);
BuildError::KVStoreSetupFailed
Expand Down
8 changes: 4 additions & 4 deletions src/chain/bitcoind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -701,10 +701,10 @@ impl BitcoindClient {
let num_blocks_json = serde_json::json!(num_blocks);
let estimation_mode_json = serde_json::json!(estimation_mode);
rpc_client
.call_method::<FeeResponse>("estimatesmartfee", &[
num_blocks_json,
estimation_mode_json,
])
.call_method::<FeeResponse>(
"estimatesmartfee",
&[num_blocks_json, estimation_mode_json],
)
.await
.map(|resp| resp.0)
}
Expand Down
12 changes: 8 additions & 4 deletions src/payment/asynchronous/static_invoice_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,14 @@ mod tests {
}

fn blinded_path() -> BlindedMessagePath {
BlindedMessagePath::from_blinded_path(pubkey(40), pubkey(41), vec![
BlindedHop { blinded_node_id: pubkey(42), encrypted_payload: vec![0; 43] },
BlindedHop { blinded_node_id: pubkey(43), encrypted_payload: vec![0; 44] },
])
BlindedMessagePath::from_blinded_path(
pubkey(40),
pubkey(41),
vec![
BlindedHop { blinded_node_id: pubkey(42), encrypted_payload: vec![0; 43] },
BlindedHop { blinded_node_id: pubkey(43), encrypted_payload: vec![0; 44] },
],
)
}

fn pubkey(byte: u8) -> PublicKey {
Expand Down
Loading