Skip to content

Commit ddea65c

Browse files
committed
f use mutator
1 parent 40d4387 commit ddea65c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lightning/src/ln/chanmon_update_fail_tests.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -2000,10 +2000,7 @@ fn test_path_paused_mpp() {
20002000
// Set it so that the first monitor update (for the path 0 -> 1 -> 3) succeeds, but the second
20012001
// (for the path 0 -> 2 -> 3) fails.
20022002
chanmon_cfgs[0].persister.set_update_ret(Ok(()));
2003-
{
2004-
let mut next_update_ret = chanmon_cfgs[0].persister.next_update_ret.lock().unwrap();
2005-
*next_update_ret = Some(Err(ChannelMonitorUpdateErr::TemporaryFailure));
2006-
}
2003+
chanmon_cfgs[0].persister.set_next_update_ret(Some(Err(ChannelMonitorUpdateErr::TemporaryFailure)));
20072004

20082005
// Now check that we get the right return value, indicating that the first path succeeded but
20092006
// the second got a MonitorUpdateFailed err. This implies PaymentSendFailure::PartialFailure as

lightning/src/util/test_utils.rs

+4
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ impl TestPersister {
173173
pub fn set_update_ret(&self, ret: Result<(), chain::ChannelMonitorUpdateErr>) {
174174
*self.update_ret.lock().unwrap() = ret;
175175
}
176+
177+
pub fn set_next_update_ret(&self, next_ret: Option<Result<(), chain::ChannelMonitorUpdateErr>>) {
178+
*self.next_update_ret.lock().unwrap() = next_ret;
179+
}
176180
}
177181
impl<Signer: keysinterface::Sign> chainmonitor::Persist<Signer> for TestPersister {
178182
fn persist_new_channel(&self, _funding_txo: OutPoint, _data: &channelmonitor::ChannelMonitor<Signer>) -> Result<(), chain::ChannelMonitorUpdateErr> {

0 commit comments

Comments
 (0)