Add "client" feature annoations

This commit is contained in:
Christian Kamm 2022-08-14 22:18:36 +02:00
parent 6a77a5c349
commit 18857c7b72
3 changed files with 4 additions and 1 deletions

View File

@ -15,7 +15,7 @@ no-idl = []
no-log-ix-name = []
cpi = ["no-entrypoint"]
default = []
test-bpf = []
test-bpf = ["client"]
client = ["solana-sdk"]
[dependencies]

View File

@ -609,6 +609,7 @@ impl HealthCache {
/// - MAX if liabs = 0
///
/// Maybe talking about the collateralization ratio assets/liabs is more intuitive?
#[cfg(feature = "client")]
pub fn health_ratio(&self, health_type: HealthType) -> I80F48 {
let (assets, liabs) = self.health_assets_and_liabs(health_type);
let hundred = I80F48::from(100);
@ -623,6 +624,7 @@ impl HealthCache {
/// above the min_ratio health ratio.
///
/// TODO: Add slippage/fees.
#[cfg(feature = "client")]
pub fn max_swap_source_for_health_ratio(
&self,
source: TokenIndex,

View File

@ -70,6 +70,7 @@ impl TokenPosition {
}
}
#[cfg(feature = "client")]
pub fn ui(&self, bank: &Bank) -> I80F48 {
if self.indexed_position.is_positive() {
(self.indexed_position * bank.deposit_index)