diff --git a/bin/liquidator/src/liquidate.rs b/bin/liquidator/src/liquidate.rs index f16e8339a..2ddd43606 100644 --- a/bin/liquidator/src/liquidate.rs +++ b/bin/liquidator/src/liquidate.rs @@ -158,7 +158,7 @@ impl<'a> LiquidateHelper<'a> { let mut health_cache = health_cache::new(&self.client.context, self.account_fetcher, &liqor) .await - .expect("always ok"); + .context("health cache")?; let quote_bank = self .client .first_bank(QUOTE_TOKEN_INDEX) diff --git a/bin/liquidator/src/util.rs b/bin/liquidator/src/util.rs index 70da942b7..274cb63a5 100644 --- a/bin/liquidator/src/util.rs +++ b/bin/liquidator/src/util.rs @@ -58,7 +58,7 @@ pub fn max_swap_source_with_limits( let health_cache = mango_v4_client::health_cache::new_sync(&client.context, account_fetcher, &account) - .expect("always ok"); + .context("health cache")?; let source_bank: Bank = account_fetcher.fetch(&client.context.token(source).first_bank())?; let target_bank: Bank = account_fetcher.fetch(&client.context.token(target).first_bank())?; @@ -100,7 +100,7 @@ pub fn max_swap_source_ignoring_limits( let health_cache = mango_v4_client::health_cache::new_sync(&client.context, account_fetcher, &account) - .expect("always ok"); + .context("health cache")?; let source_bank: Bank = account_fetcher.fetch(&client.context.token(source).first_bank())?; let target_bank: Bank = account_fetcher.fetch(&client.context.token(target).first_bank())?;