Skip to content

Commit d8b55f7

Browse files
0xahzamjordy25519
andauthored
remove align(16) (#319)
* remove align(16) on margin calculation structs * bump ffi to v2.156.3 --------- Co-authored-by: jordy25519 <beauchjord@gmail.com>
1 parent 726a2e7 commit d8b55f7

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

crates/src/ffi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,11 +1139,11 @@ pub mod abi_types {
11391139
#[repr(C, align(16))]
11401140
#[derive(Clone, Copy, Debug, Default, PartialEq)]
11411141
pub struct IsolatedMarginCalculation {
1142-
pub market_index: u16,
11431142
pub margin_requirement: u128,
11441143
pub total_collateral: i128,
11451144
pub total_collateral_buffer: i128,
11461145
pub margin_requirement_plus_buffer: u128,
1146+
pub market_index: u16,
11471147
}
11481148

11491149
impl IsolatedMarginCalculation {
@@ -1196,7 +1196,7 @@ pub mod abi_types {
11961196
pub type FfiResult<T> = RResult<T, u32>;
11971197

11981198
/// FFI-compatible simplified margin calculation result
1199-
#[repr(C, align(16))]
1199+
#[repr(C)]
12001200
#[derive(Copy, Clone, Debug, PartialEq)]
12011201
pub struct SimplifiedMarginCalculation {
12021202
pub total_collateral: i128,

crates/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,6 +1074,10 @@ impl DriftClient {
10741074
self.backend.grpc_unsubscribe();
10751075
}
10761076

1077+
pub async fn get_slot(&self) -> Option<u64> {
1078+
self.backend.client().get_slot().await.ok()
1079+
}
1080+
10771081
/// Return a reference to the internal backend
10781082
#[cfg(feature = "unsafe_pub")]
10791083
pub fn backend(&self) -> &'static DriftClientBackend {

0 commit comments

Comments
 (0)