|
1 | 1 | use {
|
2 | 2 | super::Bank,
|
3 |
| - crate::accounts_index::{ScanConfig, ScanError}, |
| 3 | + crate::accounts_index::{IndexKey, ScanConfig, ScanError}, |
4 | 4 | byteorder::{LittleEndian, ReadBytesExt},
|
5 | 5 | log::*,
|
6 | 6 | pyth_oracle::validator::AggregationError,
|
@@ -140,7 +140,12 @@ pub fn update_v1(
|
140 | 140 | let mut measure = Measure::start("update_v1_load_program_accounts");
|
141 | 141 |
|
142 | 142 | message_buffer_accounts = bank
|
143 |
| - .get_program_accounts(&MESSAGE_BUFFER_PID, &ScanConfig::new(true)) |
| 143 | + .get_filtered_indexed_accounts( |
| 144 | + &IndexKey::ProgramId(*MESSAGE_BUFFER_PID), |
| 145 | + |account| account.owner() == &*MESSAGE_BUFFER_PID, |
| 146 | + &ScanConfig::new(true), |
| 147 | + None, |
| 148 | + ) |
144 | 149 | .map_err(AccumulatorUpdateErrorV1::GetProgramAccounts)?;
|
145 | 150 |
|
146 | 151 | measure.stop();
|
@@ -380,7 +385,12 @@ pub fn update_v2(bank: &Bank) -> std::result::Result<(), AccumulatorUpdateErrorV
|
380 | 385 | let mut measure = Measure::start("update_v2_load_program_accounts");
|
381 | 386 |
|
382 | 387 | let accounts = bank
|
383 |
| - .get_program_accounts(&ORACLE_PID, &ScanConfig::new(true)) |
| 388 | + .get_filtered_indexed_accounts( |
| 389 | + &IndexKey::ProgramId(*ORACLE_PID), |
| 390 | + |account| account.owner() == &*ORACLE_PID, |
| 391 | + &ScanConfig::new(true), |
| 392 | + None, |
| 393 | + ) |
384 | 394 | .map_err(AccumulatorUpdateErrorV1::GetProgramAccounts)?;
|
385 | 395 |
|
386 | 396 | measure.stop();
|
|
0 commit comments