Skip to content

Commit

Permalink
upgrade time dependency to latest
Browse files Browse the repository at this point in the history
Signed-off-by: Swapnil Tripathi <swapnil06.st@gmail.com>
  • Loading branch information
swaptr committed Apr 26, 2023
1 parent 5cefb95 commit 3ced9ba
Show file tree
Hide file tree
Showing 16 changed files with 110 additions and 87 deletions.
116 changes: 66 additions & 50 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion aries_vcx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async-trait = "0.1.53"
env_logger = "0.9.0"
log = "0.4.16"
chrono = "0.4.23"
time = "0.1.44"
time = "0.3.20"
lazy_static = "1.3"
rand = "0.7.3"
serde = "1.0.97"
Expand Down
4 changes: 2 additions & 2 deletions aries_vcx/src/common/credentials/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{collections::HashMap, sync::Arc};

use time::get_time;
use time::OffsetDateTime;

use crate::core::profile::profile::Profile;
use crate::errors::error::{AriesVcxError, AriesVcxErrorKind, VcxResult};
Expand Down Expand Up @@ -36,7 +36,7 @@ pub async fn get_cred_rev_id(profile: &Arc<dyn Profile>, cred_id: &str) -> VcxRe

pub async fn is_cred_revoked(profile: &Arc<dyn Profile>, rev_reg_id: &str, rev_id: &str) -> VcxResult<bool> {
let from = None;
let to = Some(get_time().sec as u64 + 100);
let to = Some(OffsetDateTime::now_utc().unix_timestamp() as u64 + 100);
let rev_reg_delta = RevocationRegistryDelta::create_from_ledger(profile, rev_reg_id, from, to).await?;
Ok(rev_reg_delta.revoked().iter().any(|s| s.to_string().eq(rev_id)))
}
Expand Down
2 changes: 1 addition & 1 deletion aries_vcx/src/common/primitives/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub mod integration_tests {

let ledger = Arc::clone(&setup.profile).inject_ledger();
let (id, _rev_reg, _timestamp) = ledger
.get_rev_reg(&rev_reg_id, time::get_time().sec as u64)
.get_rev_reg(&rev_reg_id, time::OffsetDateTime::now_utc().unix_timestamp() as u64)
.await
.unwrap();

Expand Down
2 changes: 1 addition & 1 deletion aries_vcx/src/common/signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::errors::error::prelude::*;
use crate::global::settings;

async fn get_signature_data(wallet: &Arc<dyn BaseWallet>, data: String, key: &str) -> VcxResult<(Vec<u8>, Vec<u8>)> {
let now: u64 = time::get_time().sec as u64;
let now: u64 = time::OffsetDateTime::now_utc().unix_timestamp() as u64;
let mut sig_data = now.to_be_bytes().to_vec();
sig_data.extend(data.as_bytes());

Expand Down
Loading

0 comments on commit 3ced9ba

Please sign in to comment.