|
|
@@ -49,4 +49,22 @@ mod tests { |
|
|
|
Ok(false) |
|
|
|
)); |
|
|
|
} |
|
|
|
|
|
|
|
#[test] |
|
|
|
fn memory_size_of_trades_struct() { |
|
|
|
use markets::crypto::{Exchange, Ticker, Side}; |
|
|
|
|
|
|
|
struct Trade { |
|
|
|
pub time: u64, |
|
|
|
pub price: f64, |
|
|
|
pub amount: f64, |
|
|
|
pub exch: Exchange, |
|
|
|
pub ticker: Ticker, |
|
|
|
pub server_time: Option<u64>, |
|
|
|
pub side: Option<Side>, |
|
|
|
} |
|
|
|
|
|
|
|
assert_eq!(std::mem::size_of::<Trade>(), 48); |
|
|
|
assert_eq!(std::mem::size_of::<Ticker>(), 2); |
|
|
|
} |
|
|
|
} |