program: fix health check ix (#918)

This commit is contained in:
Serge Farny 2024-03-18 17:52:51 +01:00 committed by GitHub
parent 6f85dfa42d
commit 769f940a66
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 7 deletions

View File

@ -4,8 +4,7 @@ use fixed::types::I80F48;
use crate::accounts_ix::*;
use crate::error::{Contextable, MangoError};
use crate::health::{
new_fixed_order_account_retriever_with_optional_banks,
new_health_cache_skipping_missing_banks_and_bad_oracles, HealthType,
new_health_cache_skipping_missing_banks_and_bad_oracles, HealthType, ScanningAccountRetriever,
};
use crate::state::*;
use crate::util::clock_now;
@ -18,11 +17,11 @@ pub fn health_check(
let account = ctx.accounts.account.load_full_mut()?;
let (now_ts, now_slot) = clock_now();
let retriever = new_fixed_order_account_retriever_with_optional_banks(
ctx.remaining_accounts,
&account.borrow(),
now_slot,
)?;
let group_pk = &ctx.accounts.group.key();
let retriever = ScanningAccountRetriever::new(ctx.remaining_accounts, group_pk)
.context("create account retriever")?;
let health_cache = new_health_cache_skipping_missing_banks_and_bad_oracles(
&account.borrow(),
&retriever,