🐛 bug: fix 30-day scraper keys having 7 days of validity.
This won't affect anything, because I had manually written the not_after for the testing keys. Even the automated tests weren't using the new_30_day functionmain
parent
fa070ea7d0
commit
0a46fc05dc
|
@ -111,14 +111,14 @@ pub enum KeyValidity {
|
|||
DurationNegative,
|
||||
}
|
||||
|
||||
impl ScraperKey <Valid30Days> {
|
||||
impl <V: MaxValidDuration> ScraperKey <V> {
|
||||
pub fn new_30_day <S: Into <String>> (name: S, input: &[u8]) -> Self {
|
||||
let now = Utc::now ();
|
||||
|
||||
Self {
|
||||
name: name.into (),
|
||||
not_before: now,
|
||||
not_after: now + Duration::days (7),
|
||||
not_after: now + V::dur (),
|
||||
hash: BlakeHashWrapper::from_key (input),
|
||||
_phantom: Default::default (),
|
||||
}
|
||||
|
@ -227,6 +227,7 @@ mod tests {
|
|||
for (input, expected) in &[
|
||||
(zero_time + Duration::days (0), ClockIsBehind),
|
||||
(zero_time + Duration::days (2), Valid),
|
||||
(zero_time + Duration::days (29), Valid),
|
||||
(zero_time + Duration::days (1 + 30), Expired),
|
||||
(zero_time + Duration::days (100), Expired),
|
||||
] {
|
||||
|
|
Loading…
Reference in New Issue