From 1cd9f7a6e32ad8d68602db8d709a188713895034 Mon Sep 17 00:00:00 2001 From: Lucas Date: Wed, 19 Jun 2024 15:11:30 -0300 Subject: [PATCH] Make futures crate optional --- svm/src/transaction_processor.rs | 3 +-- type-overrides/Cargo.toml | 3 ++- type-overrides/src/lib.rs | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/svm/src/transaction_processor.rs b/svm/src/transaction_processor.rs index 10fe96632dafd3..1122a7d022acfe 100644 --- a/svm/src/transaction_processor.rs +++ b/svm/src/transaction_processor.rs @@ -53,14 +53,13 @@ use { transaction::{self, SanitizedTransaction, TransactionError}, transaction_context::{ExecutionRecord, TransactionContext}, }, - solana_type_overrides::sync::{atomic::Ordering, Arc, RwLock}, + solana_type_overrides::sync::{atomic::Ordering, Arc, RwLock, RwLockReadGuard}, solana_vote::vote_account::VoteAccountsHashMap, std::{ cell::RefCell, collections::{hash_map::Entry, HashMap, HashSet}, fmt::{Debug, Formatter}, rc::Rc, - sync::RwLockReadGuard, }, }; diff --git a/type-overrides/Cargo.toml b/type-overrides/Cargo.toml index 28c49f198e73e0..07b69542e53e6f 100644 --- a/type-overrides/Cargo.toml +++ b/type-overrides/Cargo.toml @@ -9,10 +9,11 @@ license = { workspace = true } edition = { workspace = true } [dependencies] -futures = { workspace = true } +futures = { workspace = true, optional = true } lazy_static = { workspace = true } rand = { workspace = true } shuttle = { workspace = true, optional = true } [features] shuttle-test = ["dep:shuttle"] +executor = ["dep:futures"] diff --git a/type-overrides/src/lib.rs b/type-overrides/src/lib.rs index d48cfadffa1eec..4d9a2ac1a63922 100644 --- a/type-overrides/src/lib.rs +++ b/type-overrides/src/lib.rs @@ -6,6 +6,8 @@ /// /// Instead of importing from std, rand, and so on, import the following from solana-type-override, /// and include the 'shuttle-test' feature in your crate to use shuttle. + +#[cfg(feature = "executor")] pub mod executor { #[cfg(not(feature = "shuttle-test"))] pub use futures::executor::*;