|
52 | 52 | AccountIndex, AccountSecondaryIndexes, AccountSecondaryIndexesIncludeExclude, |
53 | 53 | AccountsIndexConfig, IndexLimitMb, |
54 | 54 | }, |
| 55 | + bank::pyth_accumulator::{MESSAGE_BUFFER_PID, ORACLE_PID}, |
55 | 56 | hardened_unpack::MAX_GENESIS_ARCHIVE_UNPACKED_SIZE, |
56 | 57 | runtime_config::RuntimeConfig, |
57 | 58 | snapshot_config::SnapshotConfig, |
@@ -3193,6 +3194,24 @@ fn process_account_indexes(matches: &ArgMatches) -> AccountSecondaryIndexes { |
3193 | 3194 | let exclude_keys = !account_indexes_exclude_keys.is_empty(); |
3194 | 3195 | let include_keys = !account_indexes_include_keys.is_empty(); |
3195 | 3196 |
|
| 3197 | + if include_keys { |
| 3198 | + if !account_indexes_include_keys.contains(&*ORACLE_PID) || !account_indexes_include_keys.contains(&*MESSAGE_BUFFER_PID) { |
| 3199 | + panic!( |
| 3200 | + "The oracle program id and message buffer program id must be included in the account index. Add the following flags\n\ |
| 3201 | + --account-index program-id\n\ |
| 3202 | + --account-index-include-key {}\n\ |
| 3203 | + --account-index-include-key {}\n", |
| 3204 | + &*ORACLE_PID, &*MESSAGE_BUFFER_PID |
| 3205 | + ); |
| 3206 | + } |
| 3207 | + } |
| 3208 | + |
| 3209 | + if exclude_keys { |
| 3210 | + if account_indexes_exclude_keys.contains(&*ORACLE_PID) || account_indexes_exclude_keys.contains(&*MESSAGE_BUFFER_PID) { |
| 3211 | + panic!("The oracle program id and message buffer program id must *not* be excluded from the account index."); |
| 3212 | + } |
| 3213 | + } |
| 3214 | + |
3196 | 3215 | let keys = if !account_indexes.is_empty() && (exclude_keys || include_keys) { |
3197 | 3216 | let account_indexes_keys = AccountSecondaryIndexesIncludeExclude { |
3198 | 3217 | exclude: exclude_keys, |
|
0 commit comments