-
Notifications
You must be signed in to change notification settings - Fork 412
Minor code cleanups in chainmonitor.rs
#3869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor code cleanups in chainmonitor.rs
#3869
Conversation
I've assigned @jkczyz as a reviewer! |
a8a5e6b
to
6559164
Compare
CI is sad |
In c356070 we ran `rustfmt` on all of `chainmonitor.rs`, but left a few expressions in `test_async_ooo_offchain_updates` exceedingly vertical (with redundant code across both `c_bindings` compile modes). Here we reduce redundant code to simplify the expressions, reducing verticality as a side effect.
In functional tests we're slowly moving towards using `node_*_id` variables to access node ids rather than writing out `nodes[*].node.get_our_node_id()` each time. This somewhat improves readability by reducing cognitive load, so is generally nice to do as we go through rustfmt-induced changes anyway. Here we make the swap in `chainmonitor.rs` functional tests.
6559164
to
3a862a3
Compare
Ugh, sorry, forgot to let the script run long enough locally: $ git diff-tree -U2 6559164dbb 3a862a3f97
diff --git a/lightning/src/chain/chainmonitor.rs b/lightning/src/chain/chainmonitor.rs
index 326eaeb784..46ede6fd85 100644
--- a/lightning/src/chain/chainmonitor.rs
+++ b/lightning/src/chain/chainmonitor.rs
@@ -1317,5 +1317,5 @@ mod tests {
#[cfg(c_bindings)]
let pending_chan_updates =
- pending_updates.iter().find(|(chan_id, _)| *chan_id == channel_id).unwrap().1;
+ &pending_updates.iter().find(|(chan_id, _)| *chan_id == channel_id).unwrap().1;
assert!(pending_chan_updates.contains(&next_update));
@@ -1328,5 +1328,5 @@ mod tests {
#[cfg(c_bindings)]
let pending_chan_updates =
- pending_updates.iter().find(|(chan_id, _)| *chan_id == channel_id).unwrap().1;
+ &pending_updates.iter().find(|(chan_id, _)| *chan_id == channel_id).unwrap().1;
assert!(!pending_chan_updates.contains(&next_update)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Going ahead and landing this since the diff since Val's ACK is trivial.
No description provided.