Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump time to 0.3.20 #800

Merged
merged 2 commits into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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