Skip to content

Commit

Permalink
Make futures crate optional in solana-type-overrides (#1792)
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasSte authored Jun 20, 2024
1 parent 6cf3225 commit 974c013
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion programs/sbf/Cargo.lock

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

3 changes: 1 addition & 2 deletions svm/src/transaction_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
};

Expand Down
3 changes: 2 additions & 1 deletion type-overrides/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
2 changes: 2 additions & 0 deletions type-overrides/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
Expand Down

0 comments on commit 974c013

Please sign in to comment.