Skip to content

Commit 06d7c53

Browse files
committed
Re-name function parameter to 'age'
The parameter to `to_age` represents either a number of blocks _or_ a time (medium time passed). The term 'age' is associated with relative time locks in general. Use 'age' as the parameter name instead of 'time'.
1 parent 13e2c31 commit 06d7c53

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/policy/semantic.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,18 +521,18 @@ impl<Pk: MiniscriptKey> Policy<Pk> {
521521
}
522522

523523
/// Filter a policy by eliminating relative timelock constraints
524-
/// that are not satisfied at the given age.
525-
pub fn at_age(mut self, time: u32) -> Policy<Pk> {
524+
/// that are not satisfied at the given `age`.
525+
pub fn at_age(mut self, age: u32) -> Policy<Pk> {
526526
self = match self {
527527
Policy::Older(t) => {
528-
if t > time {
528+
if t > age {
529529
Policy::Unsatisfiable
530530
} else {
531531
Policy::Older(t)
532532
}
533533
}
534534
Policy::Threshold(k, subs) => {
535-
Policy::Threshold(k, subs.into_iter().map(|sub| sub.at_age(time)).collect())
535+
Policy::Threshold(k, subs.into_iter().map(|sub| sub.at_age(age)).collect())
536536
}
537537
x => x,
538538
};

0 commit comments

Comments
 (0)