Skip to content

Commit 9e00fb3

Browse files
committed
Vector is never empty
1 parent 45a56a6 commit 9e00fb3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/descriptors/mod.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,13 @@ impl LianaDescriptor {
180180

181181
/// Get an ordered list of timelocks of the recovery paths.
182182
pub fn timelock_values(&self) -> Vec<u16> {
183-
self.policy().recovery_paths.keys().copied().collect()
183+
let timelocks: Vec<u16> = self.policy().recovery_paths.keys().copied().collect();
184+
// Assert that the resulting vector is not empty
185+
assert!(
186+
!timelocks.is_empty(),
187+
"The timelock_values vector should never be empty"
188+
);
189+
timelocks
184190
}
185191

186192
/// Get the maximum size in WU of a satisfaction for this descriptor.

0 commit comments

Comments
 (0)