Skip to content

Commit

Permalink
Remove available flag in test signer
Browse files Browse the repository at this point in the history
  • Loading branch information
alecchendev committed Jun 11, 2024
1 parent f1e11b7 commit ff5c999
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions lightning/src/util/test_channel_signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ pub struct TestChannelSigner {
/// Channel state used for policy enforcement
pub state: Arc<Mutex<EnforcementState>>,
pub disable_revocation_policy_check: bool,
/// When `true` (the default), the signer will respond immediately with signatures. When `false`,
/// the signer will return an error indicating that it is unavailable.
pub available: Arc<Mutex<bool>>,
}

/// Channel signer operations that can be individually enabled and disabled. If a particular value
Expand Down Expand Up @@ -135,7 +132,6 @@ impl TestChannelSigner {
inner,
state,
disable_revocation_policy_check: false,
available: Arc::new(Mutex::new(true)),
}
}

Expand All @@ -149,7 +145,6 @@ impl TestChannelSigner {
inner,
state,
disable_revocation_policy_check,
available: Arc::new(Mutex::new(true)),
}
}

Expand All @@ -162,13 +157,9 @@ impl TestChannelSigner {

/// Marks the signer's availability.
///
/// When `true`, methods are forwarded to the underlying signer as normal. When `false`, some
/// When a certain mask is set to `true`, methods are forwarded to the underlying signer as normal. When `false`, some
/// methods will return `Err` indicating that the signer is unavailable. Intended to be used for
/// testing asynchronous signing.
pub fn set_available(&self, available: bool) {
*self.available.lock().unwrap() = available;
}

#[cfg(test)]
pub fn set_ops_available(&self, mask: u32, available: bool) {
let mut state = self.get_enforcement_state();
Expand Down

0 comments on commit ff5c999

Please sign in to comment.