Skip to content

Commit 15cb254

Browse files
committed
f complete -> completed
1 parent 54d2bbd commit 15cb254

13 files changed

+88
-88
lines changed

fuzz/src/chanmon_consistency.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out) {
365365
let keys_manager = Arc::new(KeyProvider { node_id: $node_id, rand_bytes_id: atomic::AtomicU32::new(0), enforcement_states: Mutex::new(HashMap::new()) });
366366
let monitor = Arc::new(TestChainMonitor::new(broadcast.clone(), logger.clone(), $fee_estimator.clone(),
367367
Arc::new(TestPersister {
368-
update_ret: Mutex::new(ChannelMonitorUpdateStatus::Complete)
368+
update_ret: Mutex::new(ChannelMonitorUpdateStatus::Completed)
369369
}), Arc::clone(&keys_manager)));
370370

371371
let mut config = UserConfig::default();
@@ -387,7 +387,7 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out) {
387387
let logger: Arc<dyn Logger> = Arc::new(test_logger::TestLogger::new($node_id.to_string(), out.clone()));
388388
let chain_monitor = Arc::new(TestChainMonitor::new(broadcast.clone(), logger.clone(), $fee_estimator.clone(),
389389
Arc::new(TestPersister {
390-
update_ret: Mutex::new(ChannelMonitorUpdateStatus::Complete)
390+
update_ret: Mutex::new(ChannelMonitorUpdateStatus::Completed)
391391
}), Arc::clone(& $keys_manager)));
392392

393393
let mut config = UserConfig::default();
@@ -418,7 +418,7 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out) {
418418
let res = (<(BlockHash, ChanMan)>::read(&mut Cursor::new(&$ser.0), read_args).expect("Failed to read manager").1, chain_monitor.clone());
419419
for (funding_txo, mon) in monitors.drain() {
420420
assert_eq!(chain_monitor.chain_monitor.watch_channel(funding_txo, mon),
421-
ChannelMonitorUpdateStatus::Complete);
421+
ChannelMonitorUpdateStatus::Completed);
422422
}
423423
res
424424
} }
@@ -898,9 +898,9 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out) {
898898
0x00 => *monitor_a.persister.update_ret.lock().unwrap() = ChannelMonitorUpdateStatus::InProgress,
899899
0x01 => *monitor_b.persister.update_ret.lock().unwrap() = ChannelMonitorUpdateStatus::InProgress,
900900
0x02 => *monitor_c.persister.update_ret.lock().unwrap() = ChannelMonitorUpdateStatus::InProgress,
901-
0x04 => *monitor_a.persister.update_ret.lock().unwrap() = ChannelMonitorUpdateStatus::Complete,
902-
0x05 => *monitor_b.persister.update_ret.lock().unwrap() = ChannelMonitorUpdateStatus::Complete,
903-
0x06 => *monitor_c.persister.update_ret.lock().unwrap() = ChannelMonitorUpdateStatus::Complete,
901+
0x04 => *monitor_a.persister.update_ret.lock().unwrap() = ChannelMonitorUpdateStatus::Completed,
902+
0x05 => *monitor_b.persister.update_ret.lock().unwrap() = ChannelMonitorUpdateStatus::Completed,
903+
0x06 => *monitor_c.persister.update_ret.lock().unwrap() = ChannelMonitorUpdateStatus::Completed,
904904

905905
0x08 => {
906906
if let Some((id, _)) = monitor_a.latest_monitors.lock().unwrap().get(&chan_1_funding) {
@@ -1125,9 +1125,9 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out) {
11251125
// after we resolve all pending events.
11261126
// First make sure there are no pending monitor updates, resetting the error state
11271127
// and calling force_channel_monitor_updated for each monitor.
1128-
*monitor_a.persister.update_ret.lock().unwrap() = ChannelMonitorUpdateStatus::Complete;
1129-
*monitor_b.persister.update_ret.lock().unwrap() = ChannelMonitorUpdateStatus::Complete;
1130-
*monitor_c.persister.update_ret.lock().unwrap() = ChannelMonitorUpdateStatus::Complete;
1128+
*monitor_a.persister.update_ret.lock().unwrap() = ChannelMonitorUpdateStatus::Completed;
1129+
*monitor_b.persister.update_ret.lock().unwrap() = ChannelMonitorUpdateStatus::Completed;
1130+
*monitor_c.persister.update_ret.lock().unwrap() = ChannelMonitorUpdateStatus::Completed;
11311131

11321132
if let Some((id, _)) = monitor_a.latest_monitors.lock().unwrap().get(&chan_1_funding) {
11331133
monitor_a.chain_monitor.force_channel_monitor_updated(chan_1_funding, *id);

fuzz/src/full_stack.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ pub fn do_test(data: &[u8], logger: &Arc<dyn Logger>) {
389389

390390
let broadcast = Arc::new(TestBroadcaster{ txn_broadcasted: Mutex::new(Vec::new()) });
391391
let monitor = Arc::new(chainmonitor::ChainMonitor::new(None, broadcast.clone(), Arc::clone(&logger), fee_est.clone(),
392-
Arc::new(TestPersister { update_ret: Mutex::new(ChannelMonitorUpdateStatus::Complete) })));
392+
Arc::new(TestPersister { update_ret: Mutex::new(ChannelMonitorUpdateStatus::Completed) })));
393393

394394
let keys_manager = Arc::new(KeyProvider { node_secret: our_network_key.clone(), inbound_payment_key: KeyMaterial(inbound_payment_key.try_into().unwrap()), counter: AtomicU64::new(0) });
395395
let mut config = UserConfig::default();

lightning/src/chain/chainmonitor.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ impl MonitorUpdateId {
7878
///
7979
/// Each method can return three possible values:
8080
/// * If persistence (including any relevant `fsync()` calls) happens immediately, the
81-
/// implementation should return [`ChannelMonitorUpdateStatus::Complete`], indicating normal
81+
/// implementation should return [`ChannelMonitorUpdateStatus::Completed`], indicating normal
8282
/// channel operation should continue.
8383
/// * If persistence happens asynchronously, implementations should first ensure the
8484
/// [`ChannelMonitor`] or [`ChannelMonitorUpdate`] are written durably to disk, and then return
@@ -295,7 +295,7 @@ where C::Target: chain::Filter,
295295

296296
log_trace!(self.logger, "Syncing Channel Monitor for channel {}", log_funding_info!(monitor));
297297
match self.persister.update_persisted_channel(*funding_outpoint, &None, monitor, update_id) {
298-
ChannelMonitorUpdateStatus::Complete =>
298+
ChannelMonitorUpdateStatus::Completed =>
299299
log_trace!(self.logger, "Finished syncing Channel Monitor for channel {}", log_funding_info!(monitor)),
300300
ChannelMonitorUpdateStatus::PermanentFailure => {
301301
monitor_state.channel_perm_failed.store(true, Ordering::Release);
@@ -593,7 +593,7 @@ where C::Target: chain::Filter,
593593
log_error!(self.logger, "Persistence of new ChannelMonitor for channel {} failed", log_funding_info!(monitor));
594594
return persist_res;
595595
},
596-
ChannelMonitorUpdateStatus::Complete => {
596+
ChannelMonitorUpdateStatus::Completed => {
597597
log_info!(self.logger, "Persistence of new ChannelMonitor for channel {} completed", log_funding_info!(monitor));
598598
}
599599
}
@@ -647,7 +647,7 @@ where C::Target: chain::Filter,
647647
monitor_state.channel_perm_failed.store(true, Ordering::Release);
648648
log_error!(self.logger, "Persistence of ChannelMonitorUpdate for channel {} failed", log_funding_info!(monitor));
649649
},
650-
ChannelMonitorUpdateStatus::Complete => {
650+
ChannelMonitorUpdateStatus::Completed => {
651651
log_debug!(self.logger, "Persistence of ChannelMonitorUpdate for channel {} completed", log_funding_info!(monitor));
652652
},
653653
}
@@ -765,7 +765,7 @@ mod tests {
765765
check_added_monitors!(nodes[1], 1);
766766
expect_payment_claimed!(nodes[1], payment_hash_2, 1_000_000);
767767

768-
chanmon_cfgs[1].persister.set_update_ret(ChannelMonitorUpdateStatus::Complete);
768+
chanmon_cfgs[1].persister.set_update_ret(ChannelMonitorUpdateStatus::Completed);
769769

770770
let persistences = chanmon_cfgs[1].persister.offchain_monitor_updates.lock().unwrap().clone();
771771
assert_eq!(persistences.len(), 1);
@@ -859,7 +859,7 @@ mod tests {
859859

860860
// If the ChannelManager tries to update the channel, however, the ChainMonitor will pass
861861
// the update through to the ChannelMonitor which will refuse it (as the channel is closed).
862-
chanmon_cfgs[0].persister.set_update_ret(ChannelMonitorUpdateStatus::Complete);
862+
chanmon_cfgs[0].persister.set_update_ret(ChannelMonitorUpdateStatus::Completed);
863863
unwrap_send_err!(nodes[0].node.send_payment(&route, second_payment_hash, &Some(second_payment_secret)),
864864
true, APIError::ChannelUnavailable { ref err },
865865
assert!(err.contains("ChannelMonitor storage failure")));

lightning/src/chain/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ pub enum ChannelMonitorUpdateStatus {
195195
///
196196
/// This includes performing any `fsync()` calls required to ensure the update is guaranteed to
197197
/// be available on restart even if the application crashes.
198-
Complete,
198+
Completed,
199199
/// Used to indicate a temporary failure (eg connection to a watchtower or remote backup of
200200
/// our state failed, but is expected to succeed at some point in the future).
201201
///

0 commit comments

Comments
 (0)