-
Notifications
You must be signed in to change notification settings - Fork 420
Simplify node reload logic in tests #4142
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
base: main
Are you sure you want to change the base?
Conversation
👋 Hi! I see this is a draft PR. |
a5c6ff1
to
ccd72e0
Compare
ccd72e0
to
5d9d8d0
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4142 +/- ##
==========================================
- Coverage 88.63% 88.62% -0.02%
==========================================
Files 180 180
Lines 135230 135216 -14
Branches 135230 135216 -14
==========================================
- Hits 119865 119837 -28
- Misses 12594 12609 +15
+ Partials 2771 2770 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Store the latest persisted monitor in TestChainMonitor so it no longer needs to be passed into reload. This change also makes the test more realistic. If the monitor wasn't actually persisted, it won't reload properly.
5d9d8d0
to
6688991
Compare
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, I think we can land with 1 ack
|
||
let mut deserialized_fwd_htlcs = nodes[0].node.forward_htlcs.lock().unwrap(); | ||
for scid in [scid_1, scid_2].iter() { | ||
let mut deserialized_fwd_htlcs = nodes[0].node.forward_htlcs.lock().unwrap(); for scid in [scid_1, scid_2].iter() { |
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.
nit: needs newline
} | ||
|
||
#[cfg(test)] | ||
macro_rules! reload_node_and_monitors { |
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.
Split into two macros? 😛
Store the latest persisted monitor in TestChainMonitor so it no longer needs to be passed into reload. This change also makes the test more realistic. If the monitor wasn't actually persisted, it won't reload properly.
This is a preparation for the larger channel manager refactor project.