diff --git a/core-primitives/stf-executor/Cargo.toml b/core-primitives/stf-executor/Cargo.toml index fa0f622457..7d4581de4b 100644 --- a/core-primitives/stf-executor/Cargo.toml +++ b/core-primitives/stf-executor/Cargo.toml @@ -32,7 +32,7 @@ test = [] [dependencies] # sgx dependencies sgx_types = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git" } -sgx_tstd = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } +sgx_tstd = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true, features = ["untrusted_time"] } sgx-externalities = { default-features = false, git = "https://github.com/integritee-network/sgx-runtime", branch = "master", optional = true } # local dependencies diff --git a/core-primitives/stf-executor/src/executor.rs b/core-primitives/stf-executor/src/executor.rs index e6919fd77f..1e0debe17c 100644 --- a/core-primitives/stf-executor/src/executor.rs +++ b/core-primitives/stf-executor/src/executor.rs @@ -15,12 +15,6 @@ */ -// #[cfg(all(not(feature = "std"), feature = "sgx"))] -// use crate::sgx_reexport_prelude::*; - -#[cfg(all(not(feature = "std"), feature = "sgx"))] -use std::untrusted::time::SystemTimeEx; - use crate::{ error::{Error, Result}, traits::{ diff --git a/enclave-runtime/src/cert.rs b/enclave-runtime/src/cert.rs index 84d4987c17..00c3ad68a0 100644 --- a/enclave-runtime/src/cert.rs +++ b/enclave-runtime/src/cert.rs @@ -10,7 +10,7 @@ use num_bigint::BigUint; use serde_json::Value; use sgx_tcrypto::*; use sgx_types::*; -use std::{io::BufReader, prelude::v1::*, ptr, str, time::*, untrusted::time::SystemTimeEx}; +use std::{io::BufReader, prelude::v1::*, ptr, str, time::*}; use yasna::models::ObjectIdentifier; type SignatureAlgorithms = &'static [&'static webpki::SignatureAlgorithm]; diff --git a/sidechain/consensus/slots/Cargo.toml b/sidechain/consensus/slots/Cargo.toml index 509fc7734b..a5c302432b 100644 --- a/sidechain/consensus/slots/Cargo.toml +++ b/sidechain/consensus/slots/Cargo.toml @@ -12,7 +12,7 @@ derive_more = "0.99.16" lazy_static = { version = "1.1.0", features = ["spin_no_std"] } # sgx deps -sgx_tstd = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } +sgx_tstd = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true, features = ["untrusted_time"] } # substrate deps sp-consensus-slots = { version = "0.10.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "master"} diff --git a/sidechain/consensus/slots/src/slots.rs b/sidechain/consensus/slots/src/slots.rs index f7db8fcd66..5f064c8b91 100644 --- a/sidechain/consensus/slots/src/slots.rs +++ b/sidechain/consensus/slots/src/slots.rs @@ -27,9 +27,6 @@ use std::time::{Duration, SystemTime}; pub use sp_consensus_slots::Slot; -#[cfg(all(not(feature = "std"), feature = "sgx"))] -use std::untrusted::time::SystemTimeEx; - /// Returns current duration since unix epoch. pub fn duration_now() -> Duration { let now = SystemTime::now(); diff --git a/sidechain/top-pool/Cargo.toml b/sidechain/top-pool/Cargo.toml index 49b0c48288..52de55142a 100644 --- a/sidechain/top-pool/Cargo.toml +++ b/sidechain/top-pool/Cargo.toml @@ -37,7 +37,7 @@ std = [ [dependencies] # sgx dependencies sgx_types = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } -sgx_tstd = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true, features = ["net", "thread"] } +sgx_tstd = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true, features = ["net", "thread", "untrusted_time"] } # local dependencies ita-stf = { path = "../../app-libs/stf", default-features = false } diff --git a/sidechain/top-pool/src/future.rs b/sidechain/top-pool/src/future.rs index 29b147b666..5d9d82bac7 100644 --- a/sidechain/top-pool/src/future.rs +++ b/sidechain/top-pool/src/future.rs @@ -18,9 +18,6 @@ pub extern crate alloc; -#[cfg(all(not(feature = "std"), feature = "sgx"))] -use std::untrusted::time::InstantEx; - use crate::base_pool::TrustedOperation; use alloc::{boxed::Box, fmt, sync::Arc, vec, vec::Vec}; use core::hash; diff --git a/sidechain/top-pool/src/pool.rs b/sidechain/top-pool/src/pool.rs index 3dda150cd1..2dedbea94a 100644 --- a/sidechain/top-pool/src/pool.rs +++ b/sidechain/top-pool/src/pool.rs @@ -19,9 +19,6 @@ #[cfg(all(not(feature = "std"), feature = "sgx"))] use crate::sgx_reexport_prelude::*; -#[cfg(all(not(feature = "std"), feature = "sgx"))] -use std::untrusted::time::InstantEx; - use crate::{ base_pool as base, error, primitives::TrustedOperationSource, diff --git a/sidechain/top-pool/src/validated_pool.rs b/sidechain/top-pool/src/validated_pool.rs index 50a4287ba5..dffa8ea633 100644 --- a/sidechain/top-pool/src/validated_pool.rs +++ b/sidechain/top-pool/src/validated_pool.rs @@ -29,9 +29,6 @@ use std::sync::Mutex; #[cfg(feature = "std")] use std::sync::RwLock; -#[cfg(all(not(feature = "std"), feature = "sgx"))] -use std::untrusted::time::InstantEx; - use crate::{ base_pool as base, base_pool::PruneStatus,