Skip to content

Commit

Permalink
Merge pull request hyperledger-indy#2222 from ryMarsh44/indy-sdk_2221
Browse files Browse the repository at this point in the history
Issue: 2221 - adds test and code change to not enforce timestamps if …
  • Loading branch information
Artemkaaas authored Aug 3, 2020
2 parents 767960b + 097f31a commit 064b15c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion libindy/src/services/anoncreds/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ pub fn parse_cred_rev_id(cred_rev_id: &str) -> IndyResult<u32> {
pub fn get_non_revoc_interval(global_interval: &Option<NonRevocedInterval>, local_interval: &Option<NonRevocedInterval>) -> Option<NonRevocedInterval> {
trace!("get_non_revoc_interval >>> global_interval: {:?}, local_interval: {:?}", global_interval, local_interval);

let interval = local_interval.clone().or_else(|| global_interval.clone().or(None));
let interval = local_interval
.clone()
.or_else(|| global_interval.clone().or(None))
.filter(|x| x.to.is_some() || x.from.is_some());

trace!("get_non_revoc_interval <<< interval: {:?}", interval);

Expand Down Expand Up @@ -178,6 +181,12 @@ mod tests {
assert_eq!(None, res);
}

#[test]
fn get_non_revoc_interval_for_empty_interval() {
let res = get_non_revoc_interval(&Some(NonRevocedInterval { from: None, to: None }), &None);
assert_eq!(None, res);
}

mod to_unqualified {
use super::*;

Expand Down

0 comments on commit 064b15c

Please sign in to comment.