Skip to content

backend getter added again #137

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

Merged
merged 2 commits into from
Apr 6, 2025
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
6 changes: 6 additions & 0 deletions crates/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,12 @@ impl DriftClient {
pub fn oracle_map(&self) -> Arc<MapOf<(Pubkey, u8), Oracle>> {
self.backend.oracle_map.map()
}

/// Return a reference to the internal backend
#[cfg(feature = "unsafe_pub")]
pub fn backend(&self) -> &'static DriftClientBackend {
self.backend
}
}

/// Provides the heavy-lifting and network facing features of the SDK
Expand Down
2 changes: 1 addition & 1 deletion crates/src/marketmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl Market for SpotMarket {
/// Caller can subscribe to updates via Ws with `.subscribe(..)`
/// or drive the map by calling `.sync()` periodically
pub struct MarketMap<T: AnchorDeserialize + Send> {
marketmap: Arc<DashMap<u16, DataAndSlot<T>, ahash::RandomState>>,
pub marketmap: Arc<DashMap<u16, DataAndSlot<T>, ahash::RandomState>>,
subscriptions: DashMap<u16, UnsubHandle, ahash::RandomState>,
latest_slot: Arc<AtomicU64>,
pubsub: Arc<PubsubClient>,
Expand Down
Loading